User Tools

Site Tools


tools:style_guides:r

The style guidelines that we will apply to develop with R are from the Google's R Style Guide, with the following modifications agreed by the development team:

  • Do not use dots in variable names.
  • You can use underscores in variable names.
  • Always use TRUE/FALSE instead of T/F.
  • There are two levels of comments. The first, of general purpose, starts with a single hash and a space. Comments in this level should explain what the code is doing. The second, for stuff members, starts with two hashes and a space. Comments in this level should explain details not needed to understand the general procedure but useful to make note of more technical aspects that might take time to find out later.
  • The functions do not need to have a detailed explanation of usage, inputs and outputs in the .R code file, but it has to be in the associated .Rd documentation file.
  • A history of edition will be kept at the .Rd file associated to each function. The format of the history is as follows:

History:

0.1  -  2011-03  (E. User, example.user@ic3.cat)  -  What has been done
 0.2  -  2013-03  (A. User, another.user@ic3.cat)  -  What has been changed or added.

Attention: These rules do not apply for the documentation .Rd files in 'man' folder.

tools/style_guides/r.txt · Last modified: 2018/05/30 09:59 by rserrano