[R] reorder always returns "ordered"

Joshua Wiley jwiley.psych at gmail.com
Wed Oct 6 00:41:58 CEST 2010


> sessionInfo()
R version 2.11.1 (2010-05-31)
i486-pc-linux-gnu

> x <- factor(1:5)
> x.ro <- reorder(x, rnorm(5))
> is.ordered(x.ro)
[1] FALSE
> x.ro <- reorder(x, rnorm(5), ordered=FALSE)
> is.ordered(x.ro)
[1] FALSE


On Tue, Oct 5, 2010 at 3:14 PM, Darin A. England <england at cs.umn.edu> 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)
> > 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
>
> ______________________________________________
> 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.



More information about the R-help mailing list