Re: [R] Help with sub-setting data.frame

2009-09-03 Thread Philipp Pagel
Your subset problem has been solved already but i'd like to add a comment on this: > I want all rows where TTE is equal to 0.024657534 Comparing floating point numbers for equality with '==' is problematic so a simple df[df$TTE == 0.024657534, ] can easily fail. have a look at help("=="), especi

Re: [R] Help with sub-setting data.frame

2009-09-02 Thread Worik R
Thanks. I have no idea how I did not try that. Sigh! all good now! Worik On Wed, Sep 2, 2009 at 7:04 PM, Stefan Grosse wrote: > On Wed, 2 Sep 2009 17:12:18 +1200 Worik R wrote: > > WR> I have a data frame, df that I want to extract some rows from > > What you need is subset, see > ?subset >

Re: [R] Help with sub-setting data.frame

2009-09-02 Thread Stefan Grosse
On Wed, 2 Sep 2009 17:12:18 +1200 Worik R wrote: WR> I have a data frame, df that I want to extract some rows from What you need is subset, see ?subset Example: df<-data.frame(TTE=(0:10)/100,SOME=rnorm(11)) df # subset with all columns subset(df,TTE<0.02) # the same as: df[df$TTE<0.02,] When y