> I was willing to use argument 'exclude' in function xtabs to remove some > levels of factors (xtabs help page says '"exclude: a vector of values to > be excluded when forming the set of levels of the classifying factors").
I think I see what's happening, and it's a little confusing to me, too. If your classifying factor to xtabs is not actually a factor, but say, a character vector, it will be converted to a factor while using the "exclude" argument. However, if it already is a factor, this does not happen. So, for example, contrast: trt.char <- c("A","B","C","A","B","C") xtabs(~trt.char, exclude = "B") with trt.fac <- factor(c("A","B","C","A","B","C")) xtabs(~trt.fac, exclude = "B") Hope that helps, Erik Iverson ______________________________________________ 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.