From p.dalgaard@biostat.ku.dk  Wed May  3 06:49:26 2000
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: 03 May 2000 07:49:26 +0200
Subject: [Rd] Possible bug in factor (PR#531)
In-Reply-To: Thomas Lumley's message of "Tue, 2 May 2000 17:05:51 -0700 (PDT)"
References: <Pine.GSO.4.21.0005021656010.6086-100000@mail.biostat.washington.edu>
Message-ID: <x2zoq889p5.fsf@blueberry.kubism.ku.dk>

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()<-.

We do have a problem in the documentation:

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

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

and the actual function definition says

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



-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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)
Peter Dalgaard BSA