ggpyramid: Population Pyramids with 'ggplot2'
Build population pyramids, the back-to-back bar charts of a
population by age group and sex, as layers of a 'ggplot2' plot. A
position adjustment mirrors one side and stacks subgroups within each
side, so bars, labels and lines from any layer land on the correct side
while the plot can still be faceted, themed and extended as usual. A
coordinate system labels both sides with absolute values, gives them one
shared scale, and places the age axis on either side or in a gap at the
centre. Further layers count individual records or sum aggregated values,
show proportions, label the bars, and draw a second population as a
stepped outline for comparison.
| Version: |
0.1.0 |
| Depends: |
R (≥ 4.1.0) |
| Imports: |
cli, ggplot2 (≥ 4.0.0), rlang, scales, stats, utils, vctrs |
| Suggests: |
knitr, rmarkdown, testthat (≥ 3.0.0), vdiffr |
| Published: |
2026-11-10 |
| DOI: |
10.32614/CRAN.package.ggpyramid (may not be active yet) |
| Author: |
Matan Hakim [aut,
cre, cph] |
| Maintainer: |
Matan Hakim <matanhakim at gmail.com> |
| BugReports: |
https://github.com/matanhakim/ggpyramid/issues |
| License: |
MIT + file LICENSE |
| URL: |
https://github.com/matanhakim/ggpyramid,
https://matanhakim.github.io/ggpyramid/ |
| NeedsCompilation: |
no |
| Language: |
en-GB |
| Materials: |
README, NEWS |
| CRAN checks: |
ggpyramid results |
Documentation:
Downloads:
Linking:
Please use the canonical form
https://CRAN.R-project.org/package=ggpyramid
to link to this page.