Skip to content
Back to formatted view

Raw Message

Message-ID: <OF06BA9474.AB1A49D7-ON80257411.0036EDDA-80257411.00370FB7@hsl.gov.uk>
Date: 2008-03-19T10:01:29Z
From: Richard Cotton
Subject: sort
In-Reply-To: <798292.13244.qm@hsl.gov.uk>

> Is there any function in R which sorted data as
> 
> x1 <- c(1,3,2,4,5,1)
> x2 <- c(2,0,2,3,5,2)
> TheData <- data.frame(x1,x2)
> TheData1 <- sort(TheData, by=c(x1,x2))

Yes; see ?order and the R FAQ 7.23
http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-sort-the-rows-of-a-data-frame_003f

Regards,
Richie.

Mathematical Sciences Unit
HSL


r-help-bounces at r-project.org wrote on 19/03/2008 09:41:26:

> Hello,
> 

> 
> Thanks in advance!
> Alfons
> 
> 
> 
> 
____________________________________________________________________________________
> 
> 
>    [[alternative HTML version deleted]]
> 
> ______________________________________________
> 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.


------------------------------------------------------------------------
ATTENTION:

This message contains privileged and confidential inform...{{dropped:20}}