pop_pyramid <- population_pyramid("15001", 2015,
sex = TRUE, total = TRUE,
plot = FALSE
)
ages <- round(runif(150, 0, 100))
sex <- c(rep("M", 70), rep("F", 80))
age_risk(
age = ages, sex = sex, population_pyramid = pop_pyramid,
plot = TRUE
)
Run the code above in your browser using DataLab