Re: [R] passing arguments to a function problem

2008-06-22 Thread Gabor Grothendieck
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

[R] passing arguments to a function problem

2008-06-21 Thread Jiří Voller
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<-