【发布时间】:2016-02-26 00:30:40
【问题描述】:
是否可以打印函数的参数?
例如,这是我的函数:
my_function <- function(argument_1, argument_2){
my_equation <- argument_1 + argument_2
return(my_equation)
}
我用这段代码运行它:
my_save <- my_function(argument_1=1, argument_2=123)
是否可以编写类似GET.MY.FUNCTION.PARAMETERS(my_save) 的东西,它会返回带有1, 123 的向量或列表
【问题讨论】:
-
您也可以查看
match.call,如果函数m <- match.call(); m$argument_1中的参数发生变化,您可以索引任何参数
标签: r function parameters arguments