Re: [R] Passing a large amount of parameters to a function

2011-08-24 Thread Dimitris Rizopoulos
You could use something like the following: paramsList <- list(p1 = 1:10, p2 = -5:5, p3 = 5, p4 = 8) params <- unlist(as.relistable(paramsList)) myFunc <- function (params) { params <- relist(params, skeleton = paramsList) p1 <- params$p1 p2 <- params$p2 p3 <- params$p3 p4 <-

[R] Passing a large amount of parameters to a function

2011-08-24 Thread Eran Eidinger
Hello, I have a function with a long list of parameters (of different types, numeric and string) myFunc <-function(p1, p2, p3, p4, p5...etc) { do.something(p1,p2,) } I want to loop over this to provide a different set of parameters to the list every time. for (ii in 1:N) { myFunc(p1(i