If I use recode in a pipe, I get an error:
df <- df %>%
recode(unit, .missing="g")
Error in UseMethod("recode") : no applicable method for 'recode' applied to an object of class "c('tbl_df', 'tbl', 'data.frame')"
If I pull it out of the pipe, it works fine:
df$unit <- recode(df$unit, .missing="g")
Any ideas why? I'd like to stay in the pipe if possible.