[R] slicing list with matrices
soeren.vogel at eawag.ch
soeren.vogel at eawag.ch
Wed Nov 17 15:01:49 CET 2010
A list contains several matrices. Over all matrices (list elements) I'd like to access one matrix cell:
m <- matrix(1:9, nrow=3, dimnames=list(LETTERS[1:3], letters[1:3]))
l <- list(m1=m, m2=m*2, m3=m*3)
l[[3]] # works
l[[3]][1:2, ] # works
l[[1:3]][1, 1] # does not work
How can I slice all C-c combinations in the list?
Sören
--
Sören Vogel, Dipl.-Psych. (Univ.), PhD-Student, Eawag, Dept. SIAM
+41 76 233 3637, http://www.eawag.ch, http://sozmod.eawag.ch
More information about the R-help
mailing list