I'm pulling data from a Postgres DB using the
mutate_if(lubridate::is.POSIXct, lubridate::force_tz(., tzone='UTC')) -> df
Error in UseMethod("as.fun_list") :
no applicable method for 'as.fun_list' applied to an object of class "data.frame"
To use the dot notation in
mutate_if, the function must be wrapped in
library(lubridate) df %>% mutate_if(is.POSIXct, funs(force_tz(., tzone='UTC')))
Currently, however, you cannot use the
package:: notation within
funs. Instead you would have to explicitly load the package as I did above (relevant github issue here).