【发布时间】:2019-06-24 22:55:58
【问题描述】:
我想将列列表传递给排列函数。我尝试使用 enquos 函数
column.names 在哪里
column.names <- c(colnames(SQL_Table))
column.names
[1] "plan" "class" "gender" "band" "marital_status" "acceleration" "extension"
[8] "inflation" "iss_age" "cell" "dur" "db_perk" "accel_perk" "ext_perk"
[15] "attage"
我的代码是
column.names <- c(colnames(SQL_Table))
arrange.remove <- c("cell","db_perk","accel_perk","ext_perk","attage","db_perk_compare")
arrange.columns <- setdiff(column.names,remove)
arrange_quo <- enquos(arrange.columns)
SQL_Table %>%
arrange(!!arrange_quo)
我收到了错误
Error: incorrect size (1) at position 1, expecting : 144000
【问题讨论】:
-
你需要
rlang::syms而不是enquos和拼接运算符!!!。