[R] indexing a subset dataframe

Mandy Barron BarronM at landcareresearch.co.nz
Mon Apr 16 07:07:38 CEST 2007

I am having problems indexing a subset dataframe, which was created
> waspsNoGV<-subset(wasps,site!="GV")

Fitting a linear model revealed some data points which had high
leverage, so I attempted to redo the regression without these data
which resulted in a "subscript out of bounds" error.

I'm pretty sure the problem is that the data points identified in the
regression as having high leverage were the row names carried over from
the original dataframe which had 150 rows, but when I try to remove data
point #142 from the subset dataframe this tries to reference by a
numerical index but there are only 130 data points in the subset
dataframe hence the "subscript out of bounds" message.  So I guess my
question is how do I reference the data points to drop from the
regression by name?

WARNING: This email and any attachments may be confidential ...{{dropped}}

More information about the R-help mailing list