[R] Creating subsets of a matrix

poolmunch poolmunch at gmail.com
Mon Jan 24 00:01:50 CET 2011


# 4 . (a) Create subvectors, one for boys and one for girls.


bmi.male <- subset(bmi, gender == "male")	    # Creates a subset of bmi with
male only values n=30
bmi.female <- subset(bmi, gender == "female")	    # Creates a subset of bmi
with female only values n=30
male.bmi.only <-(bmi.male [, 1])			    # To help with the next questions I
remove the "male" and 
female.bmi.only <-(bmi.female [, 1])		    # "female" columns in favour of
naming the data sets.


I went with Josh's answer and I thank you for the help I received so
quickly.
-- 
View this message in context: http://r.789695.n4.nabble.com/Creating-subsets-of-a-matrix-tp3232838p3233150.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list