Best Practice Essentials for R

DfE guidelines for writing robust, maintainable code
guide
reference
best-practice
Author

Jacob Scott

Published

March 14, 2023

Best Practice: What and Why

In R there are many ways do get the job done. None of these are bad - the right code is the code that works. That said, knowing what is best practice and striving to keep it has big benefits:

  • Your code will be easier to write (less decisions for you to make)

  • Your code will be easier to read and maintain (other people will be familiar with the conventions you use)

  • You will improve as an analyst and developer

DfE Standards for R

Wherever possible, as an organisation we seek to defer to industry standards rather than creating our own. Broadly, we therefore recommend:

A Best Practice Cheatsheet

For a quick primer on best-practice you can refer to the following cheatsheet:

View at full resolution