【发布时间】:2021-12-23 16:59:26
【问题描述】:
df <- data.frame(A = c(1,1,1), B = c(2,2,3))
variables <- c("A", "B")
dplyr::count(df, !!!rlang::sym(variables))
Error: Only strings can be converted to symbols
Run `rlang::last_error()` to see where the error occurred.
如果variables 是A 或B,但不能同时是两者,它都有效。
【问题讨论】: