bp_chart(male = 0:1)
bp_chart(male = 1)
bp_chart(male = 0)
bp_chart(male = 0, source = "gemelli1990")
bp_chart("sbp", male = 0, source = "gemelli1990")
bp_chart("dbp", male = 1, source = "gemelli1990")
bp_chart("sbp", male = 1, source = "nhlbi")
bp_chart("sbp", male = 1, source = "flynn2017")
# if you want to modify the plot, it might be helpful to see the data it is
# based on
g <- bp_chart(male = 1)
head(g$data)
# here we color the background to show the source reference values
bkgrnd <- aggregate(x = age ~ male + bp + source, data = g$data, FUN = range)
g +
ggplot2::theme_bw() +
ggplot2::geom_rect(
data = bkgrnd,
mapping = ggplot2::aes(xmin = age[, 1],
xmax = age[, 2] + 1,
ymin = -Inf,
ymax = Inf,
fill = source)
) +
ggplot2::scale_fill_manual(
name = "Data\nSource",
values = c("gemelli1990" = ggplot2::alpha("#236192", 0.5)
, "nhlbi" = ggplot2::alpha("#6F263D", 0.5)
, "lo2013" = ggplot2::alpha("#A2AAAD", 0.5)
))
Run the code above in your browser using DataLab