diff --git a/.Rbuildignore b/.Rbuildignore index 899fd80..d4d6c05 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -2,3 +2,4 @@ ^\.Rproj\.user$ ^README\.Rmd$ ^LICENSE\.md$ +^\.github$ diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..0f2fe08 --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,52 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +name: R-CMD-check + +permissions: read-all + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: macos-latest, r: 'release'} + - {os: windows-latest, r: 'release'} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::rcmdcheck + needs: check + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' diff --git a/DESCRIPTION b/DESCRIPTION index 0878523..b25882b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: idpalette -Title: Some palettes for the IDEM, IDDU, and ACEFA groups. +Title: Some palettes for the IDEM, IDDU, and ACEFA research groups Version: 0.0.0.9000 Authors@R: person("Gerry", "Ryan", , "id@em.com", role = c("aut", "cre"), diff --git a/README.Rmd b/README.Rmd index b59fb92..02c1d55 100644 --- a/README.Rmd +++ b/README.Rmd @@ -16,32 +16,56 @@ knitr::opts_chunk$set( # idpalette +Palettes based on the colour schemes for [IDEM](https://www.telethonkids.org.au/our-research/brain-and-behaviour/child-health-analytics-research-program/infectious-disease-ecology-and-modelling/), +[IDDU](https://mspgh.unimelb.edu.au/research-groups/centre-for-epidemiology-and-biostatistics-research/infectious-disease-dynamics), and [ACEFA](https://acefa-hubs.github.io) + + +[![R-CMD-check](https://github.com/idem-lab/idpalette/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/idem-lab/idpalette/actions/workflows/R-CMD-check.yaml) -COLOURS FOR EVERYONE *in IDEM, IDDU, ACEFA* ## Installation -You can install the development version of idpalette from [GitHub](https://github.com/) with: +You can install the development version of idpalette from +[GitHub](https://github.com/) with: ``` r # install.packages("devtools") devtools::install_github("idem-lab/idpalette") ``` +## Using `idpalette` +The function `idpalette` takes arguments: + +- `p`, the palette, i.e., `"idem"`, `"iddu"`, or `"acefa"`, and +- `n`, number of colours needed. + +These can also be accessed by alias functions for each palette: `idem(n)`, +`iddu(n)`, and `acefa(n)` + +If `n` is not specified, the default is the number of colours in the true base +palette, i.e., 7 for IDEM, and 5 for IDDU and ACEFA. + +Usage per above calls palettes based on the colours in the group logos. There +are also "official" versions of the palettes, which contain only the four +colours specifically selected for use by the graphic design team. + ## Main colours ### IDEM + ```{r} library(idpalette) idpalette("idem") ``` + ```{r} idpalette("idem_official") ``` ### IDDU + ```{r} idpalette("iddu") ``` @@ -51,6 +75,7 @@ idpalette("iddu_official") ``` ### ACEFA + ```{r} idpalette("acefa") ``` @@ -59,8 +84,24 @@ idpalette("acefa") idpalette("acefa_official") ``` +## Alias functions + +```{r} +idem() +``` + +```{r} +iddu() +``` + +```{r} +acefa() +``` + ## Your colours your way +As many or as few colours as you want + ```{r} idpalette("iddu", 20) ``` @@ -85,6 +126,7 @@ ggplot( colours = idpalette("iddu", 100) ) ``` + ```{r fig.height= 4} ggplot(mpg) + geom_bar( @@ -96,4 +138,3 @@ ggplot(mpg) + scale_fill_manual(values = idpalette("idem")) + theme_bw() ``` - diff --git a/README.md b/README.md index 073361c..6319637 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,15 @@ # idpalette +Palettes based on the colour schemes for +[IDEM](https://www.telethonkids.org.au/our-research/brain-and-behaviour/child-health-analytics-research-program/infectious-disease-ecology-and-modelling/), +[IDDU](https://mspgh.unimelb.edu.au/research-groups/centre-for-epidemiology-and-biostatistics-research/infectious-disease-dynamics), +and [ACEFA](https://acefa-hubs.github.io) + - -COLOURS FOR EVERYONE *in IDEM, IDDU, ACEFA* +[![R-CMD-check](https://github.com/idem-lab/idpalette/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/idem-lab/idpalette/actions/workflows/R-CMD-check.yaml) + ## Installation @@ -18,6 +23,24 @@ You can install the development version of idpalette from devtools::install_github("idem-lab/idpalette") ``` +## Using `idpalette` + +The function `idpalette` takes arguments: + +- `p`, the palette, i.e., `"idem"`, `"iddu"`, or `"acefa"`, and +- `n`, number of colours needed. + +These can also be accessed by alias functions for each palette: +`idem(n)`, `iddu(n)`, and `acefa(n)` + +If `n` is not specified, the default is the number of colours in the +true base palette, i.e., 7 for IDEM, and 5 for IDDU and ACEFA. + +Usage per above calls palettes based on the colours in the group logos. +There are also “official” versions of the palettes, which contain only +the four colours specifically selected for use by the graphic design +team. + ## Main colours ### IDEM