pyramid_chart {ggcharts} | R Documentation |
Pyramid Chart
Description
Easily create a pyramid chart
Usage
pyramid_chart(
data,
x,
y,
group,
bar_colors = c("#1F77B4", "#FF7F0E"),
sort = "no",
xlab = NULL,
title = NULL
)
Arguments
data |
Dataset to use for the pyramid chart |
x |
|
y |
|
group |
|
bar_colors |
|
sort |
|
xlab |
|
title |
|
Value
An object of class ggplot
Author(s)
Thomas Neitmann
Examples
data(popch)
pyramid_chart(popch, age, pop, sex)
## Change bar colors
pyramid_chart(popch, age, pop, sex, bar_colors = c("darkgreen", "darkorange"))
## Change x axis label and add title
pyramid_chart(popch, age, pop, sex, xlab = "Population", title = "Switzerland 2020")
[Package ggcharts version 0.2.1 Index]