#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
#> Registered S3 methods overwritten by 'ggalt':
#> method from
#> grid.draw.absoluteGrob ggplot2
#> grobHeight.absoluteGrob ggplot2
#> grobWidth.absoluteGrob ggplot2
#> grobX.absoluteGrob ggplot2
#> grobY.absoluteGrob ggplot2
Create a Dumbell chart
#Prepare data
dumbbell_df <- dta %>%
filter(LEVEL == 3 &
REGIOJ == "Belgium" &
MEASURE == "Deaths" &
METRIC == "Rate" &
AGEGRP %in% c("ALL") &
SEX == "Both sexes" &
YEAR %in% c(2004, 2018)) %>%
pivot_wider(id_cols = CAUSE, names_from = YEAR, values_from = VAL_MEAN) %>%
mutate(gap = `2018` - `2004`) %>%
arrange(desc(gap)) %>%
head(10)
#Make plot
ggplot(dumbbell_df, aes(x = `2004`, xend = `2018`, y = reorder(CAUSE, gap), group = CAUSE)) +
geom_dumbbell(colour = "#dddddd",
size = 3,
colour_x = pal_sciensano("GnRd")(6)[1],
colour_xend = pal_sciensano("GnRd")(6)[6]) +
sciensano_style() +
labs(title="Rise in deaths",
subtitle="Biggest rise in deaths, 2004-2018")
#> Warning in sciensano_style(): Please specify an available font
#> The first available font will be taken:
#> Using font:
![](e-other-charts_files/figure-html/unnamed-chunk-2-1.png)