"Roger D. Peng" <[EMAIL PROTECTED]> writes:
> Is there a way of getting the argument list of a function from within
> that function? For example, something like
>
> f <- function(x, y = 3) {
> fargs <- getFunctionArgList()
> print(fargs) ## Should be `alist(x, y = 3)'
> }
> f
func
Is formals() what you're looking for?
Andy
> From: Roger D. Peng
>
> Is there a way of getting the argument list of a function from within
> that function? For example, something like
>
> f <- function(x, y = 3) {
> fargs <- getFunctionArgList()
> print(fargs) ## Should be `alist
Ergh, yes, that's exactly it. I didn't realize you could use it in
that way.
Thanks,
-roger
Jeff Gentry wrote:
Is there a way of getting the argument list of a function from within
that function? For example, something like
Would formals() work for you here?
_
> Is there a way of getting the argument list of a function from within
> that function? For example, something like
Would formals() work for you here?
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the p
Is there a way of getting the argument list of a function from within
that function? For example, something like
f <- function(x, y = 3) {
fargs <- getFunctionArgList()
print(fargs) ## Should be `alist(x, y = 3)'
}
Thanks,
-roger
__
[E