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 attached it.

mean doesn't give error because has ... argument, sd not.


Comments

Popular posts from this blog

php - Admin SDK -- get information about the group -

dns - How To Use Custom Nameserver On Free Cloudflare? -

Python Error - TypeError: input expected at most 1 arguments, got 3 -