The goal of slrplotfun is to implement the design used by the Swedish Arthroplasty Register with figures produced by ggplot2. Functions are used for the annual report and more.
You can install the development version from GitHub with:
# install.packages("devtools")
devtools::install_github("swehip/slrplotfun")
Here are some example plots but please see the individual manual pages for a comprehensive list.
library(slrplotfun)
set.seed(123)
# Create some data
df <- data.frame(age = rpois(100000, 65),
gender = sample(c('Woman', 'Woman', 'Man'), 100000, replace = TRUE))
# Age pyramid
age_pyramid(df, age_var = 'age', gender_var = 'gender',
man_level = 'Man', title = "This is an age pyramid")