Skip to content

Commit

Permalink
Merge pull request #113 from nhs-r-community/spelling
Browse files Browse the repository at this point in the history
Added how to reference a package and function in text, use of {styler…
  • Loading branch information
Lextuga007 authored Mar 23, 2024
2 parents ea1e7cf + 60aca98 commit aa1763c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion style-guides.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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`.

0 comments on commit aa1763c

Please sign in to comment.