Add waffle
This commit is contained in:
parent
b8b50b09b2
commit
09ef523c64
1 changed files with 8 additions and 10 deletions
18
README.Rmd
18
README.Rmd
|
|
@ -128,6 +128,7 @@ df <- tibble::tibble(
|
||||||
dplyr::mutate(stat = round(stat, 0))
|
dplyr::mutate(stat = round(stat, 0))
|
||||||
|
|
||||||
# Example, adding a parameter to `theme_reach()` passed on `ggplot2::theme()` to align legend title
|
# Example, adding a parameter to `theme_reach()` passed on `ggplot2::theme()` to align legend title
|
||||||
|
|
||||||
dumbbell(df,
|
dumbbell(df,
|
||||||
stat,
|
stat,
|
||||||
setting,
|
setting,
|
||||||
|
|
@ -170,18 +171,15 @@ donut(df,
|
||||||
theme = theme_reach(legend_reverse = TRUE))
|
theme = theme_reach(legend_reverse = TRUE))
|
||||||
```
|
```
|
||||||
|
|
||||||
### Example 4: donut chart, REACH themed (to used once, not twice)
|
|
||||||
```{r example-donut-plot, out.width = "65%", warning = FALSE}
|
|
||||||
|
|
||||||
# Donut
|
### Example 5: waffle chart
|
||||||
waffle(df,
|
```{r example-waffle-plot, out.width = "65%", warning = FALSE}
|
||||||
status,
|
#
|
||||||
percentage,
|
waffle(df, status, percentage, x_title = "A caption", title = "A title", subtitle = "A subtitle")
|
||||||
title = "% of HHs by displacement status",
|
|
||||||
theme = theme_reach(legend_reverse = TRUE))
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Example 5: alluvial chart, REACH themed
|
|
||||||
|
### Example 6: alluvial chart, REACH themed
|
||||||
```{r example-alluvial-plot, out.width = "65%", warning = FALSE}
|
```{r example-alluvial-plot, out.width = "65%", warning = FALSE}
|
||||||
|
|
||||||
# Some summarized data: % of HHs by self-reported status of displacement in 2021 and in 2022
|
# Some summarized data: % of HHs by self-reported status of displacement in 2021 and in 2022
|
||||||
|
|
@ -211,7 +209,7 @@ alluvial(df,
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Example 6: lollipop chart
|
### Example 7: lollipop chart
|
||||||
```{r example-lollipop-chart, out.width = "65%", warning = FALSE}
|
```{r example-lollipop-chart, out.width = "65%", warning = FALSE}
|
||||||
library(tidyr)
|
library(tidyr)
|
||||||
# Prepare long data
|
# Prepare long data
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue