Re: [R] Problem with subset() function?

2009-01-20 Thread Steven McKinney
etting me straight. Best Steven McKinney Statistician Molecular Oncology and Breast Cancer Program British Columbia Cancer Research Centre email: smckinney +at+ bccrc +dot+ ca tel: 604-675-8000 x7561 BCCRC Molecular Oncology 675 West 10th Ave, Floor 4 Vancouver B.C. V5Z 1L3 Canada -O

Re: [R] Problem with subset() function?

2009-01-20 Thread David Winsemius
Consider an alternative and realize that it is density() that is complaining about being passed a dataframe rather than subset misbehaving: density(subset(mydf, ht >= 150.0 & wt <= 150.0)$age) Call: density.default(x = subset(mydf, ht >= 150 & wt <= 150)$age) Data: subset(mydf, ht >

Re: [R] Problem with subset() function?

2009-01-20 Thread Marc Schwartz
on 01/20/2009 05:02 PM Steven McKinney wrote: > Hi all, > > Can anyone explain why the following use of > the subset() function produces a different > outcome than the use of the "[" extractor? > > The subset() function as used in > > density(subset(mydf, ht >= 150.0 & wt <= 150.0, select = c(a

Re: [R] Problem with subset() function?

2009-01-20 Thread Andrew Robinson
Steven, check the class of the objects that you are creating. Cheers, Andrew On Wed, January 21, 2009 10:02 am, Steven McKinney wrote: > Hi all, > > Can anyone explain why the following use of > the subset() function produces a different > outcome than the use of the "[" extractor? > > The subs

[R] Problem with subset() function?

2009-01-20 Thread Steven McKinney
Hi all, Can anyone explain why the following use of the subset() function produces a different outcome than the use of the "[" extractor? The subset() function as used in density(subset(mydf, ht >= 150.0 & wt <= 150.0, select = c(age))) appears to me from documentation to be equivalent to de

Re: [R] Problem with subset

2008-06-06 Thread Charles C. Berry
On Fri, 6 Jun 2008, Luca Mortarini wrote: Hi, I am new to R and i am looking for a way to extract a subset from a vector. I have a vector of number oscillating around zero (a decreasing autocorrelation function) and i would like to extract only the first positive part of the function (from z

[R] Problem with subset

2008-06-06 Thread Luca Mortarini
Hi, I am new to R and i am looking for a way to extract a subset from a vector. I have a vector of number oscillating around zero (a decreasing autocorrelation function) and i would like to extract only the first positive part of the function (from zero lag to the lag where the function invert