【发布时间】:2015-03-23 01:10:08
【问题描述】:
又发生了。一个我刚要按下按钮发布答案的问题被删除了:
我正在寻找一种方法来从函数的省略号参数中提取绑定到符号以及符号的对象的值。也就是说,我试图以引用透明的方式从省略号中提取符号。我尝试过使用替代和lazy_dots 并没有成功。
# function I'm trying to create
get_symbols <- function(...) {
# insert code here
# should return a character vector of symbols
}
# example function calls
some_function <- function(...){
get_symbols(...)
}
z <- quote(T)
some_function(quote(x), ~y, z)
# should return vector of symbols c(x, ~y, T)
some_function(quote(x), ~y, quote(T))
# should return vector of symbols c(x, ~y, T)
【问题讨论】:
标签: r