hadley wickham wrote:
a <- data.frame(b = rep(1:5, each=2), c=factor(rep("a",10), levels=c("a","b")))
levels(subset(a, b=1, drop=T)$c)
# [1] "a" "b"

Is this a bug?


No, drop = TRUE is not doing what you're thinking it's doing. From ?subset (R-1.9.1):


   The 'drop' argument is passed on to the indexing method for data
     frames.

I think you're hoping it is passed on to the indexing method for factors, which it isn't.

--sundar

______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to