Re: [R] Selecting subset of factor levels

2011-08-18 Thread Jeff Newmiller
Your expectations of the | operator don't seem fair... you should reread ?"|" and perhaps the "Introduction to R" document. In particular, there is no "between" operator in R. The %in% operator allows you an efficient way to identify any of many specific cases. If you are working with ordered f

Re: [R] Selecting subset of factor levels

2011-08-18 Thread David Winsemius
On Aug 18, 2011, at 10:27 AM, B Jessop wrote: Dear r-help, I would like to select a subset of levels from a factor variable in a data frame and return a data frame. The data set consists of 3 variables, 2 of which are factors (Site, Fish) and one numeric (Datavalue) as follows: Site