mirror of
https://github.com/tiennm99/styleguide.git
synced 2026-10-14 18:19:10 +00:00
Update r style guide
PiperOrigin-RevId: 988536167
This commit is contained in:
1 parent
f43f7a72b5
commit
82555e4a7b
1 file changed
+12
-2
@@ -11,6 +11,10 @@ were developed in collaboration with the internal R user community. The rest of
|
||||
this document explains Google's primary differences with the Tidyverse guide,
|
||||
and why these differences exist.
|
||||
|
||||
Google uses the [styler](https://github.com/r-lib/styler) package on every
|
||||
checked in file to ensure code consistency and help reviewers focus on more
|
||||
important issues.
|
||||
|
||||
## Syntax
|
||||
|
||||
### Naming conventions
|
||||
@@ -95,8 +99,8 @@ understand dependencies in your code. There are some exceptions to this rule.
|
||||
* Infix functions (`%name%`) always need to be imported.
|
||||
* Certain `rlang` pronouns, notably `.data`, need to be imported.
|
||||
* Functions from default R packages, including `datasets`, `utils`,
|
||||
`grDevices`, `graphics`, `stats` and `methods`. If needed, you can `@import`
|
||||
the full package.
|
||||
`grDevices`, `graphics`, `stats` and `methods`. If needed, you can `@import`
|
||||
the full package.
|
||||
|
||||
When importing functions, place the `@importFrom` tag in the Roxygen header
|
||||
above the function where the external dependency is used.
|
||||
@@ -107,3 +111,9 @@ above the function where the external dependency is used.
|
||||
|
||||
All packages should have a package documentation file, in a
|
||||
`packagename-package.R` file.
|
||||
|
||||
## Errors
|
||||
|
||||
### Use of bullets
|
||||
|
||||
We prefer ASCII style bullets (`*`) to unicode when producing error messages.
|
||||
Reference in new issue
Block a user