[R] passing arguments to a function problem

From: Ji Voller <jirivoller_at_gmail.com>
Date: Sun, 22 Jun 2008 01:58:31 +0200

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. Received on Sun 22 Jun 2008 - 06:53:07 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 - 12:30:55 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