See orderBy in the doBy package.
On Sat, Jun 21, 2008 at 7:58 PM, Jiří Voller <[EMAIL PROTECTED]> wrote: > Dear R-users, > is there some way how to pass various colnames to the following code for > sorting data.frames? > > mydf.ordered<-with(mydf, mydf[order(colname1,colname2, colnameX, decreasing > = TRUE), ]) > > > > I was trying something like > > Afunction<-function (mydf,colnames,decreasing=T){ > > mydf.ordered<-with(mydf, mydf[order(colnames, decreasing = decreasing), > ]) > > } > > but it didnt work > please help > thank you > > > Jiri Voller > > [[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. > ______________________________________________ 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.