On May 12, 2010, at 3:14 PM, Clark Johnston wrote:
Is there a way to create a new matrix from and existing matrix with
A
[,1] [,2]
[1,] 1 13
[2.] 2 18
[3,] 3 14
[4,] 4 20
if()
B
[,1] [,2]
[1,] 2 18
[2,] 4 20
Try (untested absent reproducible example);
A[A[,2] > 15, ]
This (should) create a logical vector in the first argument to "["
which has the effect of returning the rows for which that vector is
TRUE.
--
View this message in context:
http://r.789695.n4.nabble.com/manipulating-a-matrix-tp2196610p2196610.html
Sent from the R help mailing list archive at Nabble.com.
______________________________________________
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.
David Winsemius, MD
West Hartford, CT
______________________________________________
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.