-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #113 from nhs-r-community/spelling
Added how to reference a package and function in text, use of {styler…
- Loading branch information
Showing
1 changed file
with
12 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,6 +114,11 @@ HTML output: | |
```R | ||
x <- c(1:21) | ||
``` | ||
## Referencing R packages and functions in text | ||
|
||
Because a number of popular R packages use common names like janitor it can help distinguish the word refers to a package by using curly brackets: {janitor}. | ||
|
||
To highlight the use of a package in text using markdown formatting put function names in back ticks: `mutate()` along with rounded brackets. | ||
|
||
# Style Guide for code | ||
|
||
|
@@ -141,6 +146,12 @@ and [CC0](https://creativecommons.org/publicdomain/zero/1.0/) for text based pro | |
|
||
>allows the creator to retain copyright whilst allowing others to copy and distribute and make use of their work non-commercially. The Creative Commons license also ensures creators get the recognition and credit for the work they produce and share. | ||
## {styler}, {lintr} packages and tidyverse Style Guide | ||
|
||
It is highly recommended that code that is produced for and by NHS-R Community has {styler} applied to it as detailed in the [R for Data Science (2nd Edition)](https://r4ds.hadley.nz/workflow-style) and the [tidyverse style guide](https://style.tidyverse.org/index.html?q=styler#welcome). | ||
|
||
The use of the package {lintr} is also highly recommended and can show particular style issues that may not be automatically corrected through using {styler}. | ||
|
||
# READMEs in repositories | ||
|
||
As standard all NHS-R GitHub repository READMEs should include the following text that refers to the Code of Conduct in this book: | ||
|
@@ -169,4 +180,4 @@ To create a code of conduct file use the code from the {usethis} package: | |
use_code_of_conduct(contact = "[email protected]") | ||
``` | ||
|
||
which generates a file `CODE_OF_CONDUCT.md`. | ||
which generates a file `CODE_OF_CONDUCT.md`. |