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: [EMAIL PROTECTED]                                Fax 7 838 4155
Phone  +64 7 838 4773 wk    Home +64 7 825 0441    Mobile 021 1395 862

______________________________________________
R-help@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.

Reply via email to