Re: [R] How to retrieve data from a matrix

2012-11-19 Thread ginger
Thank you very much, It works! -- View this message in context: http://r.789695.n4.nabble.com/How-to-retrieve-data-from-a-matrix-tp4649721p4650036.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list http

Re: [R] How to retrieve data from a matrix

2012-11-16 Thread arun
HI, Try this: dat1<-read.csv("matrixGinger.csv",sep="\t") res<-apply(dat1,1,function(x) names(x)[x<0.0165]) res1<-t(sapply(res,`[`,seq(max(sapply(res,length) res2<-data.frame(id=rownames(res1),res1) dat2<-read.csv("Gingerdat.csv",sep="\t")  res3<-merge(dat2,res2,by="id",sort=FALSE))  res3[1:5,1