On Thu, Jun 12, 2008 at 2:27 PM, Agustin Lobo <[EMAIL PROTECTED]> wrote: > Hi! > > How can I subset several variables in cast? > > For example, I can do it for one, (ie, ph): > cast(am, organismo +arriba ~ variable,subset=variable=="ph",mean,na.rm=T) > > For selecting ph, temperature and Ba I'm using: > cast(am, organismo +arriba ~ variable,subset=variable=="ph" > variable=="temperature"| variable== "Ba",mean,na.rm=T)
Probably the most compact way is: cast(am, organismo +arriba ~ variable , subset =variable %in% c("ph", "temperature","Ba") , mean, na.rm=T ) (that's an R thing, not particular to reshape) Hadley -- http://had.co.nz/ ______________________________________________ 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.