[Rd] unique turns ordered into factor (PR#2591)

p.dalgaard@biostat.ku.dk p.dalgaard@biostat.ku.dk
Fri Feb 28 16:03:33 2003


[reported originally by Christoffer Tornĝe]

> f <- ordered(month.name)
> f
 [1] January   February  March     April     May       June      July
 [8] August    September October   November  December
12 Levels: April < August < December < February < January < July < ... < September
> unique(f)
 [1] January   February  March     April     May       June      July
 [8] August    September October   November  December
12 Levels: April August December February January July June March ... September

this causes trouble in the internals of panel.superpose if the groups
argument is an ordered factor. In that case

           id <- (groups[subscripts] == vals[i])

gives off the warning

Incompatible methods ("Ops.ordered", "Ops.factor") for "=="

S-PLUS (6.0 at least) does not do this, so I assume the fix is to
modify unique.default in the obvious way.

[Still present in the development sources]

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