R获取函数参数的名称

R get names of arguments to a function

如何获取函数所有参数的名称?

func = function(a,b,c,d,e){
  return(NULL)
}

对于上面的函数,我想通过将函数的名称(即 'func')传递给其他函数来获得 c('a','b','c','d','e'),其中 returns 的字符向量参数名称。

像这样的东西(不起作用):

args(get('func'))

你想要的是:

names(formals(get("func")))