26.20 Style Resources
20200105 There are many style guides available and the guidelines here are generally consistent and overlap considerably with many others. In this chapter I aim to capture the motivation for each choice. My style choices are based on over 30 years of programming in very many different languages. Some elements of style are personal preference and others have very solid foundations. Unfortunately in reading some style guides the choices made are not always explained and without the motivation we do not really have a basis to choose or to debate.
The canonical style guide for the tidyverse is Hadley Wickham’s style guide at https://style.tidyverse.org/. Other guidelines can be found at Google and Hadley Wickham’s older guide and . These are similar though with idiosyncratic differences. Also see Wikipedia for an excellent summary of many styles.
Rasmus Bth, in , reviews naming conventions used in R, finding that the initial lower case capitalised word scheme for functions was the most popular, and dot separated names for arguments similarly. We are however seeing a migration away from the dot in variable names as it is also used as a class separator for object oriented coding. Using the underscore is now preferred.
Your donation will support ongoing development and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984.
Copyright © 1995-2021 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0.