Dear R users,

i want to put the results of a list to a for loop.

i will give an example

m1<-matrix(rep(1,15),ncol=5)
  ind.sgn <- lapply(1:ncol(m1), combn, x = ncol(m1))
 ind.sgn
[[1]]
     [,1] [,2] [,3] [,4] [,5]
[1,]    1    2    3    4    5

[[2]]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    1    1    1    2    2    2    3    3     4
[2,]    2    3    4    5    3    4    5    4    5     5

[[3]]
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]    1    1    1    1    1    1    2    2    2     3
[2,]    2    2    2    3    3    4    3    3    4     4
[3,]    3    4    5    4    5    5    4    5    5     5

[[4]]
     [,1] [,2] [,3] [,4] [,5]
[1,]    1    1    1    1    2
[2,]    2    2    2    3    3
[3,]    3    3    4    4    4
[4,]    4    5    5    5    5

[[5]]
     [,1]
[1,]    1
[2,]    2
[3,]    3
[4,]    4
[5,]    5

I want in any of theses results to put them in for loop
each time to multiply a column as indicates the list. for example
first it will multiply each column
after will multiply two columns as in [[2]]
after will multiply three columns as in [[3]]etc

any help will be welcome
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to