Skip to content
George G. Vega Yon edited this page Jan 17, 2017 · 25 revisions

Welcome to the Coding Standards Wiki! The idea of this wiki is to document whatever coding practices should we consider as standards. To contribute, please attain to the follow guidelines:

Contents

  1. Coding Standards: Anything that has to do with coding itself so that it's more readable, this includes naming variables, functions, and classes, code indenting, etc.
  2. Software Development:

Coding Standards (go back)

  1. The 80 characters rule.
  2. When possible, structure your code as sections/files, with files holding similar functions and sections to give internal structure to your file.
  3. Use indenting
  4. Explain yourself: Add comments.

Actual coding

Control-flow statements

# If it's only a single like
if (...)
  ...then...

# Several blocks
if (...) {
  ...then...
} else {
  ...
}

Variable/Objects names

  1. Never use dots to name objects, e.g. my.object
  2. Whenever possible, use informative names, e.g. loglike instead of var1

R-packages

  1. Use devtools
  2. Use travis-ci
  3. Use roxygen
  4. Use testthat + codecov

Useful references

  • The Art of R programming
  • R packages
Clone this wiki locally