> tmp <- matrix(1:24, 6, 4, dimnames=list(letters[1:6], LETTERS[1:4]))
> tmp
  A  B  C  D
a 1  7 13 19
b 2  8 14 20
c 3  9 15 21
d 4 10 16 22
e 5 11 17 23
f 6 12 18 24
> tmp[c("a", "c", "d", "f"), ]
  A  B  C  D
a 1  7 13 19
c 3  9 15 21
d 4 10 16 22
f 6 12 18 24
>


See
   ?`[`
for discussion.

        [[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.

Reply via email to