You can use split(x$Snp_ID,x$Gene)
where x is your data.frame (see ?split). --- On Tue, 24/6/08, Rajasekaramya <[EMAIL PROTECTED]> wrote: > From: Rajasekaramya <[EMAIL PROTECTED]> > Subject: [R] R help > To: r-help@r-project.org > Received: Tuesday, 24 June, 2008, 2:27 PM > Hi there, > > I am very new to R.I have to write the code for the > following scenario > > Snp_Id Gene name score > 1 a > 2 b > 3 a > 4 b > are the three columns in my table.There are many snp,s for > a particular > gene.I have to group all the snp to its corresponding > genname. > > my output should be > > genename a should have both the gene id 1 and 3. > genename b should have gene id 2 and 4 > > Kindly help me. > Ramya Thulasingam > > > > > -- > View this message in context: > http://www.nabble.com/R-help-tp18083552p18083552.html > Sent from the R help mailing list archive at Nabble.com. > > [[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. ______________________________________________ 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.