Can you be a little more concrete?
If you want the form of the expression given (rather than its value),
deparse(substitute()) will work:
fnc1 <- function(x){ deparse(substitute(x))}
fnc1(3) # 3
fnc1(x) # "x"
fnc1(x + 4) # "x+4"
If you are passing them through the ... argument, you can coerce that
to a list and use the names() attribute.
If you want to reconstruct the exact call (e.g., for a modelling
function), match.call() will do it.
Hope this helps,
Michael
On Sat, Mar 24, 2012 at 5:04 PM, Ed Siefker <[email protected]> wrote:
> Is there a way I can get the names of the arguments passed to a
> function from within a function?
>
> ______________________________________________
> [email protected] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.