[R] Odp: data order by different level of variables

Petr PIKAL petr.pikal at precheza.cz
Mon Jul 30 15:49:26 CEST 2007


Hi

r-help-bounces at stat.math.ethz.ch napsal dne 28.07.2007 02:18:33:

> Dear useR,
> 
> I have a data matrix, it has n columns, each column is a two-level 
variable
> with entires -1 and +1. They are randomly generated, now I want to order
> them like (for example, 5 columns case)
> -    -    -   -   -
> -    -   -   -    -
> .................
> (first several rows are the samples with all variables in low level)
> 
> +   -   -    -   -
> +   -   -    -    -
> .............................
> 
> 
> -   +   -    -   -
> 
> 
> +  +   -    -   -
> 
> 
> 
> + + + + +
> 
> Is there any function in R that could let me do this order by Var1 then
> order by Var2 then...order by Var n

Did you try

?order

Regards
Petr


> 
> 
> Thanks very much in advance!
> 
> 
> Best,
> 
> Leon
> 
>    [[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch 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