Create Well-documented and Annotated Code
One of the most important things you can do is write orderly, well-annotated code that not only functions well but explains what is happening and why it is happening and does so in easy-to-read and understandable language. This idea was first introduced by computer scientist Donald Knuth and is known as literate programming. Literate programming is the process of interspersing your computer code, in this case, R code, with plain-language descriptions of what the code is doing. This allows a reader to have a fully formed idea of what is going on. In R, you do this with annotation, which is simply the process of leaving notes within the code that is not actually the code itself. It’s like you are Hansel and Gretel getting dragged into the woods: you want to leave plenty of clues for your future self (or others) to be able to discern the trail you took.
Write good code for yourself and others
For any bit of R code you write, you ...