Skip to content
Prev 305241 / 398513 Next

Sort or Permutate

Hi,
You can also use:

within(small,{order(value)})
#?????????????????????????? file.name???? value
#1???? /storage/storage0/59Off.Rtable 0.2203863
#3 /storage/storage0/5912314ff.Rtable 0.2886594
#2??? /storage/storage0/5912On.Rtable 0.4052370
A.K.



----- Original Message -----
From: Berend Hasselman <bhh at xs4all.nl>
To: Alaios <alaios at yahoo.com>
Cc: R help <R-help at r-project.org>
Sent: Tuesday, September 11, 2012 11:00 AM
Subject: Re: [R] Sort or Permutate
On 11-09-2012, at 13:13, Alaios wrote:

            
Please provide data using dput.
You can do it using order() like this

small <- data.frame(file.name=c(
"/storage/storage0/59Off.Rtable",
"/storage/storage0/5912On.Rtable",
"/storage/storage0/5912314ff.Rtable"), stringsAsFactors=FALSE,
value=c(
0.220386301811093,
0.405237035258638,
0.288659374128626)
)

v.index <- order(small[,"value"])
small <- small[v.index,]
small

Berend
______________________________________________
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.