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 <-
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
2 matches
Mail list logo