> From: hadley wickham
> 
> 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?

Don't think so:

> args("[.data.frame")
function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
    1) 
NULL

So the `drop' argument is passed to the "[" method for data.frame (as
documented in ?subset), and not the "[" method for factor, as that's never
called.

Andy
 
> Thanks,,
> 
> Hadley
> 
> ______________________________________________
> [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
> 
>

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