These are the standards – or at least guidelines – that we aim to use for RIF code.
We follow the Google Java Style Guide with a couple of minor differences:
On that second point, tidying up as well as improving old code as you touch it is encouraged.
Many files still contain huge chunks of unnecessary boilerplate comments, firstly reiterating the licence, and then having a lot of nonsense about code organisation. Feel free to remove these as you find them. Just keep anything that actually provides information.
There don’t seem to be any particular standards for R coding. It’s a bit of a lawless landscape. At least try to keep the line length under 100, as per Java. Use meaningful names, and assign values with the <-
operator, rather than =
, as seems to be the standard recommendation. Why there are two ways to assign a value, I can’t even.
Google has one for JS as well, so maybe try to follow that. But with tabs.
Just don’t do anything too ugly.