调用以下函数的位置似乎有所不同,但我没有得到它。
调用此
give_names = function(...) {
sapply(substitute(list(...))[-1], deparse)
}
像那样
paste(give_names(var, sd), collapse = ", ")
#[1] "var, sd"
与称之为非常不同:
d = dplyr::mutate(data.frame(1), x = paste(give_names(var, sd), collapse = ","))
d[, "x"]
#[1] "c(\"function (x, y = NULL, na.rm = FALSE, use) \", \"{\", \" if (missing(use
# (I truncated the output, its just function definitions but not names.)
为什么mutate
会返回不同的结果?