Your specific example can just use 'prod'.
The 'prod' function uses the '...' construct
which I think is what you are looking for.
However, in concurrence with a previous answer,
it is almost surely going to be a good idea
to change your way of thinking about the problem.
One word in the R wor
On 07/15/2010 08:32 PM, Axel Urbiz wrote:
Dear users,
My apologies for the simple question. I'd like to create a function where
the number of arguments is as big as the size of my data set. Supose I have
n observations in my data, how can I write a function like
fun<- function (x1,x2,,xn)
Dear users,
My apologies for the simple question. I'd like to create a function where
the number of arguments is as big as the size of my data set. Supose I have
n observations in my data, how can I write a function like
fun <- function (x1,x2,,xn) {x1*x2*...*xn}
Thanks in advance for y
3 matches
Mail list logo