There are many good books on computer programming, but even more bad books on the same topic, unfortunately.
Here are some recommendations that I found helpful.
To discover programming as an inspiring and deeply gratifying intellectual endeavor, it helps to stay away from the “Mastering WhizzBang v2.0 in 10 easy steps” and “X for dummies” variety of flashy cookbooks and stick with the serious stuff:
Although Donald E. Knuth published the first volume of The Art of Computer Programming (TAOCP) in 1968, it is still incomplete today (Knuth, 1968).71 The volumes provide the defining treatise on the design and analysis of algorithms and evoke either reverence or fear in the initiated (i.e., a bit like The Bible):
A classic text on object-oriented programming with a mindset of combining simple functions into powerful systems is The Structure and Interpretation of Computer Programs (SICP) (Abelson, Sussman, & Sussman, 1996):72
For developing a pragmatic approach towards programming and software design, The Pragmatic Programmer: From Journeyman to Master(Hunt & Thomas, 1999) is helpful, despite its cringeworthy title.
Teach a man to fish, and he’ll use StackOverflow for a day.
Give him a fish, and he’ll use StackOverflow for a lifetime of free fish.
Joshua Ulrich (2016)
R developers devote an enormous amounts of time and effort into documenting functions and packages.
If your questions are not answered by typing ‘?’ and the name of a function, here are some pointers to online resources:
R help shows that R provides many ways of helping yourself, but also pointers to various online resources
In Section 11.4.2, we illustrated the Quick sort algorithm by an Hungarian folk dance (Küküllőmenti legényes). Readers with a deep love of folk dances should check out related enactments of sorting algorithms (created by Sapientia University, Tirgu Mures (Marosvásárhely), Romania, under the direction of Kátai Zoltán and Tóth László):
More technically minded readers should watch the following clip (and try to re-implement its sorting algorithms in R):
15 Sorting Algorithms in 6 Minutes (by Timo Bingmann):
Visualization and “audibilization” of 15 sorting algorithms in 6 minutes.
Sorts random shuffles of integers, with both speed and the number of items adapted to each algorithm’s complexity.
This concludes our links to resources on programming functions in R.
[11_functions.Rmd updated on 2023-01-30 18:15:26 by hn.]
Wickham, H., & Grolemund, G. (2017). R for data science: Import, tidy, transform, visualize, and model data. Retrieved from http://r4ds.had.co.nz
Fun fact: One of the collateral projects of TAOCP that pre-occupied the author for years was the development of a typesetting system that was able to present mathematical expressions and computer code in aesthetically pleasing form. This side-project developed into the TeX system (see Wikipedia: TeX/LaTeX for details), which is still the de facto standard in many sciences today.↩︎
This book is originally from 1984 and uses the Lisp dialect Scheme. If this seems obscure, note that SICP is widely known as “the wizard book” or “the purple book”, and was used to teach many generations of MIT students into the realms of computer science.↩︎