Re: [R] For loop

From: <ctu_at_bigred.unl.edu>
Date: Sat, 28 Jun 2008 02:58:37 -0500

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.
>



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. Received on Sat 28 Jun 2008 - 08:04:15 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 28 Jun 2008 - 08:31:11 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive