David Winsemius wrote:
How can I eliminate the BLUE category completely so I can do a t-test
using
Color (with just the RED and WHITE subjects)?
dataset$Color <- as.character(dataset$Color)
or factor(dataset$Color), even. As has been pointed out already,
t.test.formula et al. do this internally, so there was really no problem
to begin with.
BTW, the subsetting behaviour of factors is deliberate. It is not always
by definition that some categories come out empty in a subgroup (think,
e.g., a question in a questionnaire, stratified by age), and it is much
easier to remove empty levels when you don't want them than to get them
back in when you do.
--
O__ ---- Peter Dalgaard Ă˜ster Farimagsgade 5, Entr.B
c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalga...@biostat.ku.dk) FAX: (+45) 35327907
______________________________________________
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.