Michael Just <mgjust <at> gmail.com> writes: > > sc_recov.21 <- dat[dat$sc_recov=21,]
Be careful: it should be "==", not "=" when want a comparison. df = data.frame(grp = letters[1:5],val=rnorm(100)) dfab = df[df$grp=="a" | df$grp=="b",] # The simple way with "or" dfcde = df[df$grp %in% c("c","d","e"),] # The flexible was Or use the subset parameter in lattice plot Dieter ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.