Re: [R] passing arguments to a function problem

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Sun, 22 Jun 2008 06:55:31 -0400

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.
>



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. Received on Sun 22 Jun 2008 - 10:57:48 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 22 Jun 2008 - 15:30:49 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive