-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
223 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
^cccmthemes\.Rproj$ | ||
^\.Rproj\.user$ | ||
^LICENSE\.md$ | ||
^README\.Rmd$ | ||
^\.github$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# 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 | ||
|
||
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@v3 | ||
|
||
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,5 @@ | |
.httr-oauth | ||
.DS_Store | ||
.quarto | ||
|
||
*.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
--- | ||
output: github_document | ||
--- | ||
|
||
<!-- README.md is generated from README.Rmd. Please edit that file --> | ||
|
||
```{r, include = FALSE} | ||
knitr::opts_chunk$set( | ||
collapse = TRUE, | ||
comment = "#>", | ||
fig.path = "man/figures/README-", | ||
out.width = "100%" | ||
) | ||
``` | ||
|
||
# cccmthemes | ||
|
||
<!-- badges: start --> | ||
[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip) | ||
[![R-CMD-check](https://github.com/unhcr-dataviz/cccmthemes/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/unhcr-dataviz/cccmthemes/actions/workflows/R-CMD-check.yaml) | ||
[![CRAN status](https://www.r-pkg.org/badges/version/cccmthemes)](https://CRAN.R-project.org/package=cccmthemes) | ||
<!-- badges: end --> | ||
|
||
Simplify the creation of your data visualizations with the `{cccmthemes}` R package. It is designed to align your plots with [CCCM's Design Guide](https://www.cccmcluster.org/branding-collection) recommendations. This package offers a comprehensive `{ggplot2}` theme, including built-in customizations and thoughtfully crafted color palettes. | ||
|
||
## Installation | ||
|
||
Get started by installing the `{cccmthemes}` package from GitHub using the `{pak}` library: | ||
|
||
```{r install, eval=FALSE} | ||
# If pak is not yet installed, uncomment the following line: | ||
# install.packages("pak") | ||
pak::pkg_install("unhcr-dataviz/cccmthemes") | ||
``` | ||
|
||
## Usage | ||
|
||
```{r load, message = FALSE, warning = FALSE, eval=FALSE} | ||
# Load required packages | ||
library(ggplot2) | ||
library(cccmthemes) | ||
``` | ||
|
||
### Base `{ggplot2}` theme | ||
|
||
```{r base-plot, message = FALSE, warning = FALSE, out.width="90%", fig.align="center", eval=FALSE} | ||
# Apply the theme_unhcr() to your plot | ||
ggplot( | ||
mtcars, | ||
aes(x = hp, y = mpg) | ||
) + | ||
geom_point() + | ||
labs( | ||
title = "Simple scatterplot with ggplot", | ||
subtitle = "This plot shows the default style of theme_cccm()", | ||
x = "Horsepower (hp)", | ||
y = "Fuel efficiency (mpg)", | ||
caption = "Source: mtcars" | ||
) + | ||
theme_cccm() | ||
``` | ||
|
||
### Font | ||
|
||
The officially recommended font is [`Inter`](https://fonts.google.com/specimen/Inter). To ensure optimal functionality of the `{cccmthemes}` package, please make sure that the `Inter` font is installed on your device prior to usage. | ||
|
||
## Acknowledgements | ||
|
||
We extend our gratitude to the creators of the [`{hrbrthemes}`](https://github.com/hrbrmstr/hrbrthemes), [`{cowplot}`](https://github.com/wilkelab/cowplot/) and [`{unhcrthemes}`](https://github.com/unhcr-dataviz/unhcrthemes) packages that influenced the development of `{cccmthemes}`. | ||
|
||
## Contribution | ||
|
||
Contributions to `{cccmthemes}` are highly valued. If you have suggestions, uncover bugs, or envision new features, kindly submit an [issue on GitHub](https://github.com/unhcr-dataviz/cccmthemes/issues). To contribute code, don't hesitate to fork the repository and create a pull request. | ||
|
||
## License | ||
|
||
This package is distributed under the [MIT License](https://github.com/unhcr-dataviz/cccmthemes/blob/master/LICENSE.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
|
||
<!-- README.md is generated from README.Rmd. Please edit that file --> | ||
|
||
# cccmthemes | ||
|
||
<!-- badges: start --> | ||
|
||
[![Project Status: WIP – Initial development is in progress, but there | ||
has not yet been a stable, usable release suitable for the | ||
public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip) | ||
[![R-CMD-check](https://github.com/unhcr-dataviz/cccmthemes/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/unhcr-dataviz/cccmthemes/actions/workflows/R-CMD-check.yaml) | ||
[![CRAN | ||
status](https://www.r-pkg.org/badges/version/cccmthemes)](https://CRAN.R-project.org/package=cccmthemes) | ||
<!-- badges: end --> | ||
|
||
Simplify the creation of your data visualizations with the | ||
`{cccmthemes}` R package. It is designed to align your plots with | ||
[CCCM’s Design Guide](https://www.cccmcluster.org/branding-collection) | ||
recommendations. This package offers a comprehensive `{ggplot2}` theme, | ||
including built-in customizations and thoughtfully crafted color | ||
palettes. | ||
|
||
## Installation | ||
|
||
Get started by installing the `{cccmthemes}` package from GitHub using | ||
the `{pak}` library: | ||
|
||
``` r | ||
# If pak is not yet installed, uncomment the following line: | ||
# install.packages("pak") | ||
|
||
pak::pkg_install("unhcr-dataviz/cccmthemes") | ||
``` | ||
|
||
## Usage | ||
|
||
``` r | ||
# Load required packages | ||
library(ggplot2) | ||
library(cccmthemes) | ||
``` | ||
|
||
### Base `{ggplot2}` theme | ||
|
||
``` r | ||
# Apply the theme_unhcr() to your plot | ||
ggplot( | ||
mtcars, | ||
aes(x = hp, y = mpg) | ||
) + | ||
geom_point() + | ||
labs( | ||
title = "Simple scatterplot with ggplot", | ||
subtitle = "This plot shows the default style of theme_cccm()", | ||
x = "Horsepower (hp)", | ||
y = "Fuel efficiency (mpg)", | ||
caption = "Source: mtcars" | ||
) + | ||
theme_cccm() | ||
``` | ||
|
||
### Font | ||
|
||
The officially recommended font is | ||
[`Inter`](https://fonts.google.com/specimen/Inter). To ensure optimal | ||
functionality of the `{cccmthemes}` package, please make sure that the | ||
`Inter` font is installed on your device prior to usage. | ||
|
||
## Acknowledgements | ||
|
||
We extend our gratitude to the creators of the | ||
[`{hrbrthemes}`](https://github.com/hrbrmstr/hrbrthemes), | ||
[`{cowplot}`](https://github.com/wilkelab/cowplot/) and | ||
[`{unhcrthemes}`](https://github.com/unhcr-dataviz/unhcrthemes) packages | ||
that influenced the development of `{cccmthemes}`. | ||
|
||
## Contribution | ||
|
||
Contributions to `{cccmthemes}` are highly valued. If you have | ||
suggestions, uncover bugs, or envision new features, kindly submit an | ||
[issue on GitHub](https://github.com/unhcr-dataviz/cccmthemes/issues). | ||
To contribute code, don’t hesitate to fork the repository and create a | ||
pull request. | ||
|
||
## License | ||
|
||
This package is distributed under the [MIT | ||
License](https://github.com/unhcr-dataviz/cccmthemes/blob/master/LICENSE.md). |