Re: [R] argument 'exclude' in function xtabs

2009-04-26 Thread Matthieu Lesnoff
<- factor(c(rep(c("A","B","C"), 2), NA), exclude = NULL) > x [1] ABCABC Levels: A B C > table(x, exclude = "B") x ABC 2221 Finally, if I remove NA, it works again: > x <- factor(rep(c(&q

Re: [R] argument 'exclude' in function xtabs

2009-04-26 Thread Matthieu Lesnoff
quot;: > x <- factor(c(rep(c("A","B","C"), 2), NA), exclude = NULL) > x [1] ABCABC Levels: A B C > table(x, exclude = "B") x ABC 2221 Finally, if I remove NA, it works again: > x <- fact

Re: [R] argument 'exclude' in function xtabs

2009-04-24 Thread Erik Iverson
> 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.

[R] argument 'exclude' in function xtabs

2009-04-24 Thread Matthieu Lesnoff
Dear all 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 tried: > mydata <- data.frame( treatment = c("B", "A", "C",