[R] passing arguments to a function problem

Gabor Grothendieck ggrothendieck at gmail.com
Sun Jun 22 12:55:31 CEST 2008


See orderBy in the doBy package.

On Sat, Jun 21, 2008 at 7:58 PM, Jiří Voller <jirivoller at gmail.com> 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 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.
>


More information about the R-help mailing list