[Rd] Possible bug in factor (PR#531)

Martin Maechler Martin Maechler <maechler@stat.math.ethz.ch>
Wed, 3 May 2000 09:38:45 +0200 (CEST)


>>>>> "PD" == Peter Dalgaard BSA <p.dalgaard@biostat.ku.dk> writes:

    PD> Thomas Lumley <thomas@biostat.washington.edu> writes:
    >> In this particular case you know that x has class
    >> c("ordered","factor") and that you want it to have class "factor",
    >> so it is harmless. It still may be unnecessary -- eg if you just
    >> want it to have treatment contrasts rather than polynomial contrasts
    >> you can use C() or constrasts()<-.

    PD> We do have a problem in the documentation:

    PD> The default for factor is ordered=FALSE according to the help page
    PD> but

    >> factor(ordered(4:1),ordered=F)
    PD> [1] 4 3 2 1 Levels: 1 2 3 4
    >> factor(ordered(4:1))
    PD> [1] 4 3 2 1 Levels: 1 < 2 < 3 < 4

    PD> and the actual function definition says

    PD> function (x, levels = sort(unique(x), na.last = TRUE),
    PD> labels=levels, exclude = NA, ordered = is.ordered(x))

I've fixed the docu for "r-release" [1.0.2 if ever].

BTW:  A branch merge would come handy...
      (should I try, using instructions on the R-developers' page?)

Martin
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._