Re: [R] Sandard deviation calculation

2009-10-27 Thread marcos carvajalino
Yup you're right, after posting i took a better look at the subsetting, found the problem and post again, my bad... 2009/10/27 Duncan Murdoch : > On 27/10/2009 2:58 PM, marcos carvajalino wrote: >> >> Dear ms. >> >> The most possible reason for this: >> >>> Dear all >>> I am trying to learn R >>>

Re: [R] Sandard deviation calculation

2009-10-27 Thread Duncan Murdoch
On 27/10/2009 2:58 PM, marcos carvajalino wrote: Dear ms. The most possible reason for this: Dear all I am trying to learn R I was trying to calculate standard deviation here are the commands and outputs in R sd(Ht_cm[type=='SD'])[1] 3.283605> sd(Ht_cm[from_treeline=='above'])[1] 16.83289> >

Re: [R] Sandard deviation calculation

2009-10-27 Thread marcos carvajalino
Hi ms. also try this: sd(Ht_cm[type=='SD' && from_treeline=='above']) cause i think you can't use [][] two apply 2 conditions to a data frame, in that cases you should use an AND (&&) conector like above 2009/10/27 marcos carvajalino : > Dear ms. > > The most possible reason for this: > >>Dear

Re: [R] Sandard deviation calculation

2009-10-27 Thread marcos carvajalino
Dear ms. The most possible reason for this: >Dear all >I am trying to learn R >I was trying to calculate standard deviation >here are the commands and outputs in R >> sd(Ht_cm[type=='SD'])[1] 3.283605> sd(Ht_cm[from_treeline=='above'])[1] >> 16.83289> >sd(Ht_cm[type=='SD'][from_treeline=='above'

Re: [R] Sandard deviation calculation

2009-10-26 Thread Wolfgang Raffelsberger
Dear MS, please follow the posting guide and provide reproducible lines of code ! Like this I have no idea what's inside your Ht_cm object . Maybe the problem is that your data might contain NAs, since the basic formula doesn't allow missing values. In this case you have to specify how the fu

Re: [R] Sandard deviation calculation

2009-10-26 Thread Duncan Murdoch
On 10/26/2009 11:05 AM, hadley wickham wrote: What are the values of length((Ht_cm[type=='SD'][from_treeline=='above'])[1]) I suspect the error is in the subsetting - the following seems more plausible: Ht_cm[type=='SD' && from_treeline=='above'] But don't double that ampersand: use Ht_

Re: [R] Sandard deviation calculation

2009-10-26 Thread hadley wickham
> What are the values of > > Ā length((Ht_cm[type=='SD'][from_treeline=='above'])[1]) I suspect the error is in the subsetting - the following seems more plausible: Ht_cm[type=='SD' && from_treeline=='above'] Hadley -- http://had.co.nz/ __ R-help@r-p

Re: [R] Sandard deviation calculation

2009-10-26 Thread Ted Harding
On 26-Oct-09 09:44:55, ms.com wrote: > > Dear all > I am trying to learn R > I was trying to calculate standard deviation > here are the commands and outputs in R >> sd(Ht_cm[type=='SD'])[1] 3.283605 >> sd(Ht_cm[from_treeline=='above'])[1] 16.83289 >> sd(Ht_cm[type=='SD'][from_treeline=='above'])[

[R] Sandard deviation calculation

2009-10-26 Thread ms.com
Dear all I am trying to learn R I was trying to calculate standard deviation here are the commands and outputs in R > sd(Ht_cm[type=='SD'])[1] 3.283605> sd(Ht_cm[from_treeline=='above'])[1] > 16.83289> sd(Ht_cm[type=='SD'][from_treeline=='above'])[1] NA> the problem is that, i could not unders