[R] Programming Concepts and Philosophy

From: Murray Jorgensen <maj_at_stats.waikato.ac.nz>
Date: Fri, 20 Jun 2008 14:35:03 +1200

I am wondering if people on the list could recommend books that they have found helpful about programming concepts and style? I often find that students write R programs by copying existing code but could really benefit from the understanding of more general programming ideas. An example would be to avoid writing functions which attempt to modify their parameters. Another principle would be not to write programs with numbers used as constants but to assign them to named objects as in

n <- 120 # number of observations
p <- 10 # number of variables

near the beginning of a program rather than using "10" and "120" throughout the script.

This sort of stuff is not specifically R but can be a problem for students with little programming background.

I am happy to summarise responses.

Murray Jorgensen

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    Home +64 7 825 0441    Mobile 021 1395 862

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 20 Jun 2008 - 04:23:03 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 Fri 20 Jun 2008 - 07:30:43 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