Hi, Probably it should be useful to obtain two "results" which you can combine according to what you need. Here a possible solution:
a<-b<-data.frame(matrix(runif(30),10,3)) d<-list(a,b) #your list #extract the 1st column. The output is a nrow(a)-by-length(d) matrix sapply(d,function(x)x[,1]) #extract the 1st row. The output is a ncol(a)-by-length(d) matrix sapply(d,function(x)x[1,]) #a ncol(a)-by-length(d) matrix Note if the dimensions of dataframes are different you will get lists. Anyway, if you prefer lists rather than matrices use lapply() best, vito ----- Original Message ----- From: Perez Martin, Agustin <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, September 16, 2004 1:33 PM Subject: [R] Indexing lists > DeaR useRs: > > I have a list with 500 elements, in each other there are data.frames and I > want to take the first row and the first column of each elements of my list > since the first to the 500-th. > > Thanks and excuse my bad English. > > --- > > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > [EMAIL PROTECTED] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html ______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html