R & quosures - How to get names of symbols contained in a vector passed as function argument?
问题 I want to write an R function arg2str that returns the names (that is a vector of strings) of the symbols that are fed as arguments. For the most simple case, I only have one input symbol: library ("rlang") arg2str.v0 <- function (arg) rlang::quo_name (enquo (arg)) arg2str.v0 (a) ## [1] "a" If I have multiple symbols, I can use the three-dots construct: arg2str.v1 <- function (...) sapply (enquos (...), rlang::quo_name) arg2str.v1 (a, b, c) ## ## "a" "b" "c" (Subsidiary question: why is the