The following is an adaptation of Google's R Style Guide, and is written here to motivate good writing practices for all package contributors. Following the guidelines below will help make LOGAN's source code easier to read, share and verify.
It is important to notice the correct letter case used in the guidelines below. The Windows Operating System may not differentiate between lowecase and uppercase letters, but other OSs such as GNU/Linux and MacOS (not to mention the R language itself) do, so a file called "A.R" is different from another called "a.r".
.R
.FunctionName
.variable.name
.For example, instead of this:
if (x == 1)
{
print(x)
}
write this:
if (x == 1) {
print(x)
}
The exception is the else
statement, which should occupy the same line as the closing brace of the previous if
statement, like this:
if (x == 1) {
print(x)
} else {
print("not one")
}
<-
, not =
.;
or attach
.=
, ==
, +
, !=
, <-
, etc.) must have spaces before and after. There is no space after an opening parenthesis or before a closing parenthesis.#
. All comments need one space after #
.# TODO:
comment should be written in the README.md
file under Section Planned features
.In order to avoid unnecessary merging conflicts and keep our work as organized as possible, please follow the instructions below:
master
if the package does not pass all devtools tests---run devtools::test()
and check if all results fall under the "OK" category---and the output of devtools::check()
is perfect (i.e., no errors, warnings or notes).master
. However, changing build version numbers in other branches is useful and allowed to make sure that what you are seeing relates to the latest build. Use it as a last resource, and consider simply discarding the change to the package version before merging back to master
.origin
.?utils::person
.Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.