[R] For loop

ctu at bigred.unl.edu ctu at bigred.unl.edu
Sat Jun 28 09:58:37 CEST 2008


Hi,
I guess this what your need. I assume your output is 10 by 11 matrix.  
However, you still need to define your geneset function(?)

result<- list()
output<-matrix(NA, nrow=10, ncol=11)
for(i in 1:length(ncol(output)))
   {
    result[[i]] <- geneset(which(geneset %n% output[1,]))
     }


Chunhao



Quoting Rajasekaramya <ramya.victory at gmail.com>:

>
> Hi,
>
> Could you please let me know to use a list in a for loop here geneset is a
> loop.I am trying to match the names of the list with 1st row of the output.
>
> result<- list()
> for(i in 1:length(output)
>
> {
> result[[i]] <- geneset(which(geneset %n% output[,1]))
> }
>
>
> Kindly help me out
>
> --
> View this message in context:   
> http://www.nabble.com/For-loop-tp18163665p18163665.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at 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.
>



More information about the R-help mailing list