[R] reorder always returns "ordered"

David Winsemius dwinsemius at comcast.net
Wed Oct 6 00:34:53 CEST 2010


On Oct 5, 2010, at 6:14 PM, Darin A. England wrote:

> 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)
>> is.ordered(x.ro)  # should be FALSE according to ?reorder
> [1] TRUE

Unable to reproduce on a fresh session.
 > is.ordered(x)
[1] FALSE
 > x.ro <- reorder(x, rnorm(5))
 >
 > is.ordered(x.ro)
[1] FALSE

On a mac 2.11.1 (also tried replicating this process 200 times to see  
if it were d/t an occasional "ordering" of rnorm(5).)

-- 
David.

>>
>> 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
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list