Please see also [wiki:"CodingForTor/CodingInC" CodingForTor/CodingInC] and [wiki:"CodingForTor/LoggingAndDocumentation" CodingForTor/LoggingAndDocumentation] because it is best to follow the guidelines there that may apply to R as well as c.
In addition please:
* end files with a newline
* use a maximum of 74 character per line
* use two spaces for indentation, four for following lines, no tabs
* use no trailing whitespace
You may find the following helpful to place in your .emacs This is derived from [[BR]]https://cran.r-project.org/doc/manuals/R-ints.html#R-coding-standards
Note that I would love to not make it indent so far for continued expressions, but I don't know how to do this. I have read through the elisp for emacs ess mode, but as far as I can tell the indent functions would have to be rewritten to support this.