Try this: DF <- data.frame(ID = sample(5), v = rnorm(5)) DF[order(DF$ID),]
On Fri, Jun 12, 2009 at 3:54 PM, MarcioRibeiro <mes...@pop.com.br> wrote: > > Hi listers, > I have a data frame with 5 variables... And I want reorder the data frame > according a specific variable X... > I checked the sort and order functions... In my case I think that the ORDER > function is applicable... But I did not understand at all... The idea is > simple... Data order by X... > I know that this is very simple... Anyways... How I would do that... > Thanks in advance, > Marcio > > -- > View this message in context: > http://www.nabble.com/Order-data-frame-tp24004394p24004394.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@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. > -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O [[alternative HTML version deleted]]
______________________________________________ R-help@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.