On 03/08/10 21:50, GL wrote:
If I have a column with 2 levels, but one level has no remaining
observations. Can I remove the level?

Like this?

d <- data.frame(a = factor(rep("A", 3), levels = c("A", "B")))
levels(d$a)
# [1] "A" "B"
d$a <- d$a[,drop=TRUE]
levels(d$a)
# [1] "A"


Hope this helps

Allan

______________________________________________
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.

Reply via email to