From Martin Maechler <maechler@stat.math.ethz.ch>  Wed May  3 08:38:45 2000
From: Martin Maechler <maechler@stat.math.ethz.ch> (Martin Maechler)
Date: Wed, 3 May 2000 09:38:45 +0200 (CEST)
Subject: [Rd] Possible bug in factor (PR#531)
In-Reply-To: <x2zoq889p5.fsf@blueberry.kubism.ku.dk>
References: <Pine.GSO.4.21.0005021656010.6086-100000@mail.biostat.washington.edu>
 <x2zoq889p5.fsf@blueberry.kubism.ku.dk>
Message-ID: <14607.55173.968286.549995@lynne.ethz.ch>

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


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