Skip to content

How to count the number of parameters in a function

1 message · Clément Calenge

#
You can use list(...):

Myfunc<-function(...)
{
d<-list(...)
n<-length(d)
## Other instructions
return(n)
}

##  Example:

var1<-runif(20)
var2<-rnorm(20)
var3<-rpois(20, 2)
Myfunc(var1, var2, var3)

Hope this helps,

Clem.
At 08:55 09/04/2003 +0100, arnaud_amsellem at ssga.com wrote: