[R] reorder always returns "ordered"

Darin A. England england at cs.umn.edu
Wed Oct 6 00:14:37 CEST 2010


Or at least is seems that way to me. It's not a big problem, but the
behavior doesn't match the documentation. (I think r-help is the
place to report this. )

> x <- factor(1:5)
> x.ro <- reorder(x, rnorm(5))
> is.ordered(x.ro)  # should be FALSE according to ?reorder
[1] TRUE
> 
> x.ro <- reorder(x, rnorm(5), ordered=FALSE)
> is.ordered(x.ro)  # should be FALSE
[1] TRUE


Here is my session info:
> sessionInfo()
R version 2.11.1 (2010-05-31) 
x86_64-unknown-linux-gnu 

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=C              LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] splines   datasets  utils     stats     graphics  grDevices
methods  
[8] base     

other attached packages:
[1] Design_2.3-0    Hmisc_3.8-3     survival_2.35-8 RODBC_1.3-2    
[5] MASS_7.3-7      lattice_0.19-11

loaded via a namespace (and not attached):
[1] cluster_1.13.1 grid_2.11.1    tools_2.11.1



More information about the R-help mailing list