[R] Correct Syntax for subset.data.frame()

Rich Shepard rshepard at appl-ecosys.com
Thu Sep 1 01:55:22 CEST 2011

   I want to create individual data.frames for each of the 8 param factors in
chemdata. The syntax I tried (based on Teetor's book, page 132) and R's
response are:

> ars <- subset(chemdata, select=c(site,sampdate,param,quant), subset=(param
= "As"))
Error in subset.data.frame(chemdata, select = c(site, sampdate, param,  :
   'subset' must evaluate to logical

   I'm asking for columns of type factor, date, factor, and numeric. What
have I done incorrectly here?


More information about the R-help mailing list