On 9/6/07, João Fadista <[EMAIL PROTECTED]> wrote: > I would like to know how can I order a data.frame with increasing the > dat$Interval (dat$Interval is a factor). There is an example below. > > Original data.frame: > > > dat > Interval Number_reads > 0-100 685 > 200-300 744 > 100-200 1082 > 300-400 4213 > > > >Desired_dat: > > Interval Number_reads > 0-100 685 > 100-200 1082 > 200-300 744 > 300-400 4213
What about Desired_dat <- dat[match(dat$Interval,sort(dat$Interval)),] ? Paul ______________________________________________ R-help@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.