Skip to content
mdijkstra edited this page Sep 25, 2014 · 13 revisions
  • Please make use of our template for R-scripts
  • No magic. Use command line parameters to indicate clearly input and output of script
  • Avoid the use of global variables from within functions (e.g. with <<-)
  • Functions should have only one task
  • Use tabs for indentation, not spaces
  • Use = for assignments, not <-
  • If main code is in main.R, put its functions in main_functions.R
  • R-scripts are ignorant of their location. Here we explain how to source(main_functions.R)
  • Please note our guidelines for documentation and tests
  • Always use < (smaller than) and <=, not > and not >=
  • Always put constants first, e.g. if (1 == my.variable) …
  • See also Google's R-style guide
    • E.g. FunctionName, file_name.R, variable.name
Clone this wiki locally