r - Standard deviation for a subset -
i trying calculate mean , standard deviation variable within subset. coding works fine mean not sd. have included sample data= orf1 came subset. help?
mean(stocking.density2012,na.rm=true,data=orf1) [1] 13.72386 > sd(stocking.density2012,na.rm=true,data=orf1) error in sd(stocking.density2012, na.rm = true, data = orf1) : unused argument (data = orf1) region stocking.density2012 1 12 8 7 2 12 8 17 1 34 3 24 1 16 2 5 1 5 4 11 1 5 3 3 7 3 5 13 1 18 4 15 2 18 1 10 6 5 1 10 5 46 1 19 3 12 1 15 6 4 1 4 7 8 1 8 8 12
data
neither argument mean
nor sd
, stocking.density2012
must in enclosing environment. perhaps attach
ed it.
mean
doesn't give error because has ...
argument, sd
not.
Comments
Post a Comment