Re: [Rd] Best practices for writing R functions

From: Alireza Mahani <alireza.s.mahani_at_gmail.com>
Date: Sat, 23 Jul 2011 05:57:41 -0700 (PDT)

The fact that R doesn't automatically copy the function argument is very useful when you mainly want to pass arguments to another function. Thanks to all of you for mentioning this!

Another trick to reduce verbosity of code (and focus on algorithm logic rather than boilerplate code) is to maintain a global copy of variables (in the global environment) which makes them visible to all functions (where appropriate, of course). Once the development and testing is finished, one can tidy things up and modify the function prototypes, add lines for unpacking lists inside functions, etc.

--
View this message in context: http://r.789695.n4.nabble.com/Best-practices-for-writing-R-libraries-tp3686674p3688850.html
Sent from the R devel mailing list archive at Nabble.com.

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Sat 23 Jul 2011 - 12:59:11 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

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 Wed 27 Jul 2011 - 01:30:12 GMT.

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

list of date sections of archive