[R] Macros versus functions

Murray Jorgensen maj at stats.waikato.ac.nz
Thu Nov 7 22:13:34 CET 2002

R is a function-oriented language and functions have the advantage that 
they control unintended side effects of computations on the workspace. 
Still, there are times when I am using R when I want to make a large 
number of changes to the worksheet repeatedly and where the easiest way 
  seems to be to keep pasting in the same chunk of code, or to put it on 
a file and use source("filename"). So effectively R does have macros as 
well as functions.

Question: is the use of macros in this way 'bad practice' to be 
deprecated, and if so why? (If I decide that it is bad practice I will 
probably go on being bad, but I will try not to pass on bad habits to my 


Dr Murray Jorgensen      http://www.stats.waikato.ac.nz/Staff/maj.html
Department of Statistics, University of Waikato, Hamilton, New Zealand
Email: maj at waikato.ac.nz                                Fax 7 838 4155
Phone  +64 7 838 4773 wk    +64 7 849 6486 home     Mobile 021 395 862

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list