_ _ _ _ _____ _____ _
| | | | | | | |/ ____| | __ \ | |
| |__| | __ _ _ __ __| | ___| | | __ _ __ ___ _ _ _ __ | |__) |_ _ ___| | ____ _ __ _ ___
| __ |/ _` | '_ \ / _` |/ _ \ | | |_ | '__/ _ \| | | | '_ \| ___/ _` |/ __| |/ / _` |/ _` |/ _ \
| | | | (_| | | | | (_| | __/ | |__| | | | (_) | |_| | |_) | | | (_| | (__| < (_| | (_| | __/
|_| |_|\__,_|_| |_|\__,_|\___|_|\_____|_| \___/ \__,_| .__/|_| \__,_|\___|_|\_\__,_|\__, |\___|
| | __/ |
|_| |___/
2025-06-05: Now Andreas thinks you shouldn't install this package because it isn't on CRAN. So if you need any of the code you should copy and paste it
hgp is a package for storing utility functions for use across
handelgroup. Right now, hgp contains the following utilities:
- A group-standard
ggplot2theme 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. (ZB isn't sure that this is the best way to do this going forward because it relies on someone maintaining the list and probably no one else will do that.)
Because this repo is public, absolutely NO sensitive or confidential information should be stored here. This repo is strictly for shared utilities.
You can install the development version of hgp from GitHub with:
# install.packages("remotes")
remotes::install_github("ahgroup/hgp")Or if you are in a repository with renv enabled (recommended):
renv::install("ahgroup/hgp")If you have a ggplot2 plot already created, you can add an hgp theme
to it in the same way as any other theme
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.
ggplot2::theme_set(hgp::theme_ms())- If you contribute to
hgp, please follow the following steps. - We recommend referring to the appropriate section(s) in R Packages, 2e 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
roxygen2syntax, and you should usedevtools::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 tobuildthe package, we just need to ensure that any checks pass. renvis initialized for this repository using the EXPLICIT snapshot mode.- If you need to import a new package, you MUST update the
NAMESPACEfile appropriately before invokingrenv::snapshot(). - Remember to keep the
NAMESPACEand lockfile up to date as you add new functionality. You can update theNAMESPACEviausethis::use_package(). - Developer-only dependencies like
devtoolsandusethiswill thus not appear in the lockfile, which is the currently recommended best practice.
- If you need to import a new package, you MUST update the
- If you are a new author, you should add your information to the
DESCRIPTIONfile. The easiest way is to useusethis::use_author(). See again the R packages book for information on the different fields here. - If you update the
README, you should only editREADME.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.
For some reason, R CMD check started returning a NOTE that says
checking for non-standard things in the check directory … NOTE
Found the following files/directories:
‘’NULL’’
Zane has absolutely no idea where this came from or how to fix it.