Skip to content
Prev 17577 / 398502 Next

indexing data.frames

graham lawrence wrote:
I'm not quite sure if I understand your question correctly.
Here an example for indexing data.frames in a list:

 x <- data.frame(a1=1:10, b1=2:11)
 y <- data.frame(a2=11:20, b2=12:21)
 L <- list(x=x, y=y)
 
 L # two data.frames in a list.
 L[[1]][[1]][1] # first list element, first col, first item
 L[[1]][[2]][3] # first list element, second col, third item
 L[[2]][[2]][10] # second list element, second col, last item

Uwe Ligges
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._