levels() counter-intuitif? (PR#1693)

David Brahm brahm@alum.mit.edu
Wed, 19 Jun 2002 13:50:07 -0400


rjvbertin@hotmail.com writes:
> Suppose I have a factor size with levels "small", "medium" and "large". 
> Then, when I subset this factor:
> >ss<-size[size!="medium"]
> to get at the extremes,
> >levels(ss)
> ....
> Levels:  large medium small

Try:
  R> ss <- size[size != "medium", drop=T]
  R> levels(ss)
     [1] "large" "small"

By the way, this type of question probably belongs in R-help, not R-devel, and
you will likely get grief for submitting it as a "bug".
-- 
                              -- David Brahm (brahm@alum.mit.edu)
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._