Skip to content

Commit

Permalink
docs: edit README, fix URLs and edit news.md for CRAN submission
Browse files Browse the repository at this point in the history
  • Loading branch information
vidonne committed Jan 3, 2025
1 parent 2878429 commit a83c74c
Show file tree
Hide file tree
Showing 15 changed files with 53 additions and 51 deletions.
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# unhcrthemes (development version)

## Minor improvements and fixes

- In `theme_unhcr()`, set `legend.location = "plot"` and `legend.justification.top = 0`.

- In `continuous_scale()`, `discrete_scale()` and `binned_scale()`, removed deprecated `scale_name` argument.

# unhcrthemes 0.6.2

## Minor changes
Expand Down
23 changes: 9 additions & 14 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ knitr::opts_chunk$set(
)
```

# unhcrthemes <img src='man/figures/logo.svg' align="right" alt="unhcrthemes package hex sticker" width="140" />
# unhcrthemes <img src='man/figures/logo.svg' align="right" alt="unhcrthemes package hex sticker" width="140" alt="unhcrthemes package hex sticker" />

<!-- badges: start -->
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
[![R-CMD-check](https://github.com/unhcr-dataviz/unhcrthemes/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/unhcr-dataviz/unhcrthemes/actions/workflows/R-CMD-check.yaml)
[![CRAN status](https://www.r-pkg.org/badges/version/unhcrthemes)](https://CRAN.R-project.org/package=unhcrthemes)
<!-- badges: end -->

Simplify the creation of your data visualizations with the `{unhcrthemes}` R package. It is designed to align your plots with [UNHCR's data visualization](https://dataviz.unhcr.org/general_guidance/) recommendations. This package offers a comprehensive `{ggplot2}` theme, including built-in customizations and thoughtfully crafted color palettes.
Simplify the creation of your data visualizations with the `{unhcrthemes}` R package. It is designed to align your plots with [UNHCR's data visualization](https://dataviz.unhcr.org/guidance/) recommendations. This package offers a comprehensive `{ggplot2}` theme, including built-in customizations and thoughtfully crafted color palettes.

## Features

- A consistent and appealing `{ggplot2}` theme that matches [UNHCR Data Visualization Guidelines](https://dataviz.unhcr.org/general_guidance/).
- A collection of color palettes ensuring your plots are consistent with [UNHCR's color scheme](https://dataviz.unhcr.org/general_guidance/).
- A consistent and appealing `{ggplot2}` theme that matches [UNHCR Data Visualization Guidelines](https://dataviz.unhcr.org/guidance/).
- A collection of color palettes ensuring your plots are consistent with [UNHCR's color scheme](https://dataviz.unhcr.org/guidance/).
- Easy-to-use functions to apply the theme and color palettes to your `{ggplot2}` plots.

## Installation
Expand Down Expand Up @@ -77,7 +77,7 @@ ggplot(

### Fonts

One of the two officially recommended fonts outlined in the [UNHCR Data Visualization Guidelines](https://dataviz.unhcr.org/general_guidance/) is [`Lato`](https://fonts.google.com/specimen/Lato). To ensure optimal functionality of the `{unhcrthemes}` package, please make sure that the `Lato` font is installed on your device prior to usage.
One of the two officially recommended fonts outlined in the [UNHCR Data Visualization Guidelines](https://dataviz.unhcr.org/guidance/) is [`Lato`](https://fonts.google.com/specimen/Lato). To ensure optimal functionality of the `{unhcrthemes}` package, please make sure that the `Lato` font is installed on your device prior to usage.

For `R` PDF (`pdf`) and PostScript (`postcript`) devices, there is a function `import_lato` that can be used to import the `Lato` font into these two devices. We recommend the use of `cairo_pdf` or `cairo_ps` devices, which work when you have `Lato` installed. They are available on all platforms and have better support custom fonts.

Expand Down Expand Up @@ -135,15 +135,10 @@ dplyr::count(mpg, class) |>
theme_unhcr(grid = FALSE, axis = "y", axis_title = FALSE, axis_text = "y")
```

Explore more examples of `{unhcrthemes}` in action on the [package vignette](https://unhcr-dataviz.github.io/unhcrthemes/articles/intro-unhcrthemes.html) or [UNHCR Data Visualization Platform](https://dataviz.unhcr.org/tools/r/).
Explore more examples of `{unhcrthemes}` in action on the [package vignette](https://unhcr-dataviz.github.io/unhcrthemes/articles/unhcrthemes.html) or [UNHCR Data Visualization Platform](https://dataviz.unhcr.org/tutorials/r/).

## Additional UNHCR Tools

- [`{refugees}`](https://github.com/PopulationStatistics/refugees): A comprehensive package for accessing [UNHCR Refugee Population Statistics Database](https://www.unhcr.org/refugee-statistics/download/).
- [`{unhcrdown}`](https://github.com/unhcr-dataviz/unhcrdown): UNHCR branded templates for [R Markdown](https://rmarkdown.rstudio.com/).
- [`quarto-revealjs-unhcr`](https://github.com/unhcr-dataviz/quarto-revealjs-unhcr): A [Quarto](https://quarto.org/) extension to create [UNHCR branded](https://www.unhcr.org/brand) `reveal.js` presentations.
- [`quarto-html-unhcr`](https://github.com/unhcr-dataviz/quarto-html-unhcr): A [Quarto](https://quarto.org/) extension to create [UNHCR branded](https://www.unhcr.org/brand) `HTML` document.
- [Data Visualization Platform](https://dataviz.unhcr.org/): A collection of recommendations on selecting the best type of chart, general dataviz design, tools and tutorials and a selection of data visualization products made by UNHCR.
```{r child="man/rmdfragments/unhcr_tools.Rmd"}
```

## Acknowledgements

Expand Down
61 changes: 27 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,32 @@

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

# unhcrthemes <img src='man/figures/logo.svg' align="right" alt="unhcrthemes package hex sticker" width="140" />
# unhcrthemes <img src='man/figures/logo.svg' align="right" alt="unhcrthemes package hex sticker" width="140" alt="unhcrthemes package hex sticker" />

<!-- badges: start -->

[![Project Status: Active – The project has reached a stable, usable
state and is being actively
developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Lifecycle:
stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
[![R-CMD-check](https://github.com/unhcr-dataviz/unhcrthemes/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/unhcr-dataviz/unhcrthemes/actions/workflows/R-CMD-check.yaml)
[![CRAN
status](https://www.r-pkg.org/badges/version/unhcrthemes)](https://CRAN.R-project.org/package=unhcrthemes)
<!-- badges: end -->

Simplify the creation of your data visualizations with the
`{unhcrthemes}` R package. It is designed to align your plots with
[UNHCR’s data
visualization](https://dataviz.unhcr.org/general_guidance/)
[UNHCR’s data visualization](https://dataviz.unhcr.org/guidance/)
recommendations. This package offers a comprehensive `{ggplot2}` theme,
including built-in customizations and thoughtfully crafted color
palettes.

## Features

- A consistent and appealing `{ggplot2}` theme that matches [UNHCR
Data Visualization
Guidelines](https://dataviz.unhcr.org/general_guidance/).
- A collection of color palettes ensuring your plots are consistent
with [UNHCR’s color
scheme](https://dataviz.unhcr.org/general_guidance/).
- Easy-to-use functions to apply the theme and color palettes to your
`{ggplot2}` plots.
- A consistent and appealing `{ggplot2}` theme that matches [UNHCR Data
Visualization Guidelines](https://dataviz.unhcr.org/guidance/).
- A collection of color palettes ensuring your plots are consistent with
[UNHCR’s color scheme](https://dataviz.unhcr.org/guidance/).
- Easy-to-use functions to apply the theme and color palettes to your
`{ggplot2}` plots.

## Installation

Expand Down Expand Up @@ -82,8 +78,8 @@ ggplot(
### Fonts

One of the two officially recommended fonts outlined in the [UNHCR Data
Visualization Guidelines](https://dataviz.unhcr.org/general_guidance/)
is [`Lato`](https://fonts.google.com/specimen/Lato). To ensure optimal
Visualization Guidelines](https://dataviz.unhcr.org/guidance/) is
[`Lato`](https://fonts.google.com/specimen/Lato). To ensure optimal
functionality of the `{unhcrthemes}` package, please make sure that the
`Lato` font is installed on your device prior to usage.

Expand Down Expand Up @@ -157,28 +153,25 @@ dplyr::count(mpg, class) |>
<img src="man/figures/README-geom-plot-1.png" width="90%" style="display: block; margin: auto;" />

Explore more examples of `{unhcrthemes}` in action on the [package
vignette](https://unhcr-dataviz.github.io/unhcrthemes/articles/intro-unhcrthemes.html)
vignette](https://unhcr-dataviz.github.io/unhcrthemes/articles/unhcrthemes.html)
or [UNHCR Data Visualization
Platform](https://dataviz.unhcr.org/tools/r/).
Platform](https://dataviz.unhcr.org/tutorials/r/).

## Additional UNHCR Tools

- [`{refugees}`](https://github.com/PopulationStatistics/refugees): A
comprehensive package for accessing [UNHCR Refugee Population
Statistics
Database](https://www.unhcr.org/refugee-statistics/download/).
- [`{unhcrdown}`](https://github.com/unhcr-dataviz/unhcrdown): UNHCR
branded templates for [R Markdown](https://rmarkdown.rstudio.com/).
- [`quarto-revealjs-unhcr`](https://github.com/unhcr-dataviz/quarto-revealjs-unhcr):
A [Quarto](https://quarto.org/) extension to create [UNHCR
branded](https://www.unhcr.org/brand) `reveal.js` presentations.
- [`quarto-html-unhcr`](https://github.com/unhcr-dataviz/quarto-html-unhcr):
A [Quarto](https://quarto.org/) extension to create [UNHCR
branded](https://www.unhcr.org/brand) `HTML` document.
- [Data Visualization Platform](https://dataviz.unhcr.org/): A
collection of recommendations on selecting the best type of chart,
general dataviz design, tools and tutorials and a selection of data
visualization products made by UNHCR.
<!-- * [**unhcrthemes**](https://github.com/unhcr-dataviz/unhcrthemes): UNHCR branded ggplot2 theme and color palettes -->

- [**unhcrdown**](https://github.com/unhcr-dataviz/unhcrdown): UNHCR
templates for R Markdown
- [**refugees**](https://github.com/PopulationStatistics/refugees):
Access to [UNHCR Refugee Data
Finder](https://www.unhcr.org/refugee-statistics) API
- [**quarto-html-unhcr**](https://github.com/unhcr-dataviz/quarto-html-unhcr):
Quarto extension for UNHCR branded HTML documents
- [**quarto-revealjs-unhcr**](https://github.com/unhcr-dataviz/quarto-revealjs-unhcr):
Quarto extension for UNHCR branded presentations
- [**Data Visualization Platform**](https://dataviz.unhcr.org/): UNHCR’s
data visualization guidelines and tools

## Acknowledgements

Expand Down
Binary file modified man/figures/README-base-plot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-geom-plot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed man/figures/README-load-1.png
Binary file not shown.
Binary file removed man/figures/README-palette-1.png
Binary file not shown.
Binary file modified man/figures/README-palette-all-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-palette-blue-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed man/figures/README-plot-theme-1.png
Binary file not shown.
Binary file removed man/figures/README-plot-theme-color-1.png
Binary file not shown.
Binary file removed man/figures/README-plot-theme-fill-1.png
Binary file not shown.
Binary file modified man/figures/README-scale-plot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions man/rmdfragments/unhcr_tools.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Additional UNHCR Tools

<!-- * [**unhcrthemes**](https://github.com/unhcr-dataviz/unhcrthemes): UNHCR branded ggplot2 theme and color palettes -->
* [**unhcrdown**](https://github.com/unhcr-dataviz/unhcrdown): UNHCR templates for R Markdown
* [**refugees**](https://github.com/PopulationStatistics/refugees): Access to [UNHCR Refugee Data Finder](https://www.unhcr.org/refugee-statistics) API
* [**quarto-html-unhcr**](https://github.com/unhcr-dataviz/quarto-html-unhcr): Quarto extension for UNHCR branded HTML documents
* [**quarto-revealjs-unhcr**](https://github.com/unhcr-dataviz/quarto-revealjs-unhcr): Quarto extension for UNHCR branded presentations
* [**Data Visualization Platform**](https://dataviz.unhcr.org/): UNHCR's data visualization guidelines and tools
6 changes: 3 additions & 3 deletions vignettes/unhcrthemes.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ knitr::opts_chunk$set(
)
```

The `{unhcrthemes}` package provides tools to create `{ggplot2}` visualizations that adhere to the [United Nations High Commissioner for Refugees (UNHCR) data visualization guidelines](https://dataviz.unhcr.org/general_guidance/).
The `{unhcrthemes}` package provides tools to create `{ggplot2}` visualizations that adhere to the [United Nations High Commissioner for Refugees (UNHCR) data visualization guidelines](https://dataviz.unhcr.org/guidance/).

One of the main functions, `theme_unhcr`, allows for the easy application of UNHCR theme to your `{ggplot2}` graphics.

Expand Down Expand Up @@ -216,7 +216,7 @@ ggplot(

### Axis ticks

Even if axis ticks aren't part of the [UNHCR data visualization guidelines](https://dataviz.unhcr.org/general_guidance/), they can sometimes be useful. To control the visibility of axis ticks, you can use the `axis_ticks` parameter in the `theme_unhcr` function. By default, this parameter is set to `FALSE`, which turns off all the axis ticks. Using `axis_ticks = TRUE` adds both X and Y axis ticks, `axis_ticks = "X"` adds only the X axis ticks, `axis_ticks = "Y"` adds only the Y axis ticks, and `axis_ticks = FALSE` removes all axis ticks.
Even if axis ticks aren't part of the [UNHCR data visualization guidelines](https://dataviz.unhcr.org/guidance/), they can sometimes be useful. To control the visibility of axis ticks, you can use the `axis_ticks` parameter in the `theme_unhcr` function. By default, this parameter is set to `FALSE`, which turns off all the axis ticks. Using `axis_ticks = TRUE` adds both X and Y axis ticks, `axis_ticks = "X"` adds only the X axis ticks, `axis_ticks = "Y"` adds only the Y axis ticks, and `axis_ticks = FALSE` removes all axis ticks.

## Text

Expand Down Expand Up @@ -350,4 +350,4 @@ ggplot(

With `{unhcrthemes}`, creating UNHCR-compliant visualizations in `R` is straightforward, providing a consistent and branded look for your graphics.

For more information on each parameter and usage, visit the [function documentation page](https://unhcr-dataviz.github.io/unhcrthemes/reference/index.html) and the [UNHCR Data Visualization Platform](https://dataviz.unhcr.org/tools/r/)
For more information on each parameter and usage, visit the [function documentation page](https://unhcr-dataviz.github.io/unhcrthemes/reference/index.html) and the [UNHCR Data Visualization Platform](https://dataviz.unhcr.org/tutorials/r/)

0 comments on commit a83c74c

Please sign in to comment.