Skip to content

Commit

Permalink
docs: adds README
Browse files Browse the repository at this point in the history
  • Loading branch information
wzbillings committed Nov 3, 2023
1 parent 9f4bf71 commit 665c17f
Show file tree
Hide file tree
Showing 3 changed files with 189 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
^renv$
^renv\.lock$
^.*\.Rproj$
^\.Rproj\.user$
^LICENSE\.md$
^README\.Rmd$
90 changes: 90 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@

<!-- README.md is generated from README.qmd. Please edit that file -->

# `hgp: HandelGroupPackage`

<!-- badges: start -->
<!-- badges: end -->

`hgp` is a package for storing utility functions for use across
handelgroup. Right now, `hgp` only contains a `ggplot2` theme. But we
will update this description as we add more stuff.

**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("devtools")
devtools::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.
- Note that as of `2023-11-03`, we have not decided on a package
license, so you will get one warning in the check results for that.
- `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.
96 changes: 96 additions & 0 deletions README.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---
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%"
)
```

# `hgp: HandelGroupPackage`

<!-- badges: start -->
<!-- badges: end -->

`hgp` is a package for storing utility functions for use across handelgroup.
Right now, `hgp` only contains a `ggplot2` theme. But we will update this
description as we add more stuff.

**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("devtools")
devtools::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.
* Note that as of `2023-11-03`, we have not decided on a package license,
so you will get one warning in the check results for that.
* `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.

0 comments on commit 665c17f

Please sign in to comment.