我用这个例子:
df <- data.frame(start = c("2016-09-30 00:00:00", "2016-09-30 00:00:00", "2016-09-30 00:00:00"), end = c("2017-03-12 00:00:00", "2017-06-30 00:00:00", "2017-12-01 00:00:00"))
library(dplyr)
library(lubridate)
df <- df %>%
mutate(across(everything(), ymd_hms),
diff = as.numeric(difftime(end, start, units = 'days')))
但是我收到此错误:
Error in across(everything(), ymd_hms) : could not find function "across"
我该如何解决?