-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.qmd
112 lines (91 loc) · 4.23 KB
/
README.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
---
format: gfm
---
<!-- README.md is generated from README.qmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
# fig.path = "man/figures/README-",
out.width = "100%"
)
```
<!-- ASCII ART BANNER TITLE -->
```
_ _ _ _ _____ _____ _
| | | | | | | |/ ____| | __ \ | |
| |__| | __ _ _ __ __| | ___| | | __ _ __ ___ _ _ _ __ | |__) |_ _ ___| | ____ _ __ _ ___
| __ |/ _` | '_ \ / _` |/ _ \ | | |_ | '__/ _ \| | | | '_ \| ___/ _` |/ __| |/ / _` |/ _` |/ _ \
| | | | (_| | | | | (_| | __/ | |__| | | | (_) | |_| | |_) | | | (_| | (__| < (_| | (_| | __/
|_| |_|\__,_|_| |_|\__,_|\___|_|\_____|_| \___/ \__,_| .__/|_| \__,_|\___|_|\_\__,_|\__, |\___|
| | __/ |
|_| |___/
```
<!-- END OF TITLE -->
# `hgp: HandelGroupPackage`
<!-- badges: start -->
<!-- badges: end -->
`hgp` is a package for storing utility functions for use across handelgroup.
Right now, `hgp` contains the following utilities:
* A group-standard `ggplot2` theme function;
* A set of functions for working with HAI data;
* A function to standardize influenza strain names for the strains used in the
datasets we have available to us; along with a corresponding data set of
standardized strain names.
**Because this repo is public, absolutely NO sensitive or confidential
information should be stored here. This repo is strictly for shared utilities.**
## Installation
You can install the development version of hgp from [GitHub](https://github.com/) with:
``` r
# install.packages("remotes")
remotes::install_github("ahgroup/hgp")
```
Or if you are in a repository with `renv` enabled (recommended):
``` r
renv::install("ahgroup/hgp")
```
## Using the `ggplot2` theme
If you have a `ggplot2` plot already created, you can add an `hgp` theme to
it in the same way as any other theme
```r
library(ggplot2)
## basic example code
ggplot(mtcars) +
aes(x = wt, y = mpg) +
geom_point() +
hgp::theme_ms()
```
You can also implement an `hgp` theme at the global (script) level. After
executing this code, all `ggplot` objects you produce afterwards will use this
theme.
```r
ggplot2::theme_set(hgp::theme_ms())
```
## Contributions
* If you contribute to `hgp`, please follow the following steps.
* We recommend referring to the appropriate section(s) in
[R Packages, 2e](https://r-pkgs.org/) for any confusing steps.
* Ensure that you run `usethis::git_vaccinate()` on every local environment
(typically new machine) that you intend to edit this package on. This helps
to prevent leakage of PII.
* All functions should be documented using standard `roxygen2` syntax, and you
should use `devtools::document()` to generate the documentation files.
* Please run `devtools:check()` before merging any new functionality to the
main branch and fix any resulting messages. It is unnecessary to `build` the
package, we just need to ensure that any checks pass.
* `renv` is initialized for this repository using the EXPLICIT snapshot mode.
* If you need to import a new package, you MUST update the `NAMESPACE` file
appropriately before invoking `renv::snapshot()`.
* Remember to keep the `NAMESPACE` and lockfile up to date as you add new
functionality. You can update the `NAMESPACE` via `usethis::use_package()`.
* Developer-only dependencies like `devtools` and `usethis` will thus not
appear in the lockfile, which is the currently recommended best practice.
* If you are a new author, you should add your information to the `DESCRIPTION`
file. The easiest way is to use `usethis::use_author()`. See again the
R packages book for information on the different fields here.
* If you update the `README`, you should only edit `README.qmd`. Make sure to
render the file manually after updating.
* If you intend to add new functionality, you should either fork the repo or
make a new branch. This way, other users can continue to install the working
version of the package while you develop new features. Remember to commit
your work regularly.