On Oct 24, 2011, at 12:10 PM, Rich Shepard wrote:
On Mon, 24 Oct 2011, David Winsemius wrote:
The appearance of levels with all zeroes is probably because I
didn't include drop.unused.levels = FALSE in the xtabs specification.
OK. Adding 'drop.unused.levels' does make a huge difference.
You could also have saved the subsetted data, applied `factor` to the
subsetted column and then used `xtabs`.
temp <- subset(chemdata, <your subset criteria>, <your column
selection>)
temp$param <- factor(temp$param)
(Now only levels that exist are in the temp version.)
--
David Winsemius, MD
West Hartford, CT
______________________________________________
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.