[R] Removing
bad2101 at columbia.edu
bad2101 at columbia.edu
Wed Aug 20 20:24:58 CEST 2008
I think I should be clearer. Given the matrix of column vectors Age,
Sex, and Ill
Age=c(11,52,65,59,13,63,70,40,15,33,65,38,62,10,25,32,62,36,11,33,13,7,64,3,65,59,15,62,37,17,35,15,50,40,35,35,36,57,16,68,54,77,72,58,20,17,62,20,52,9,50,8,35,48,25,11,74,12,44,53,37,24,69,7,17,8,11,17,36,21,60,18,14,52,45)
Sex=c("Male","Female","Male","Female","Female","Female","Male","Female","Female","Female","Male","Female","Female","Male","Male","Female","Female","Male","Male","Female","Female","Male","Male","Male","Female","Female","Female","Male","Female","Male","Male","Male","Female","Male","Female","Female","Male","Female","Female","Male","Female","Male","Female","Male","Male","Male","Female","Female","Female","Female","Male","Male","Female","Female","Male","Female","Male","Female","Female","Female","Male","Female","Female","Male","Female","Female","Female","Male","Female","Female","Male","Female","Female","Male","Female")
Ill=c("No","Yes","Yes","Yes","No","Yes","Yes","Yes","Yes","Yes","No","No","No","Yes","No","Yes","Yes","Yes","No","Yes","Yes","Yes","No","Yes","No","Yes","Yes","No","Yes","No","Yes","Yes","Yes","No","No","Yes","No","Yes","Yes","Yes","No","Yes","Yes","Yes","No","No","Yes","Yes","Yes","No","No","Yes","No","Yes","Yes","No","Yes","Yes","Yes","Yes","No","No","No","No","Yes","Yes","No","No","No","Yes","Yes","Yes","No","Yes","Yes")
o=order(Ill)
cbind(Age[o],Sex[o],Ill[o])
I am trying to remove all rows of the matrix in which the element in
the Ill column vector is "No". I appreciate any help you have to offer.
Brian
More information about the R-help
mailing list