Re: [R] Creating functions of "many" arguments

2010-07-16 Thread Patrick Burns
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

Re: [R] Creating functions of "many" arguments

2010-07-15 Thread Erik Iverson
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)

[R] Creating functions of "many" arguments

2010-07-15 Thread Axel Urbiz
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