box_plots: Plot a series of boxplots

View source: R/quick_charts.R

box_plotsR Documentation

Plot a series of boxplots

Description

Plot a series of boxplots

Usage

box_plots(
  data,
  timeperiod,
  value,
  title = "",
  subtitle = "",
  xlab = "",
  ylab = ""
)

Arguments

data

data.frame or tibble which will be fed into ggplot functions. This object should contain the fields used for the arguments within this function

timeperiod

unquoted field name for the field containing the time period

value

unquoted field name for the field containing the values for the indicator that is being plotted

title

string; title of chart

subtitle

string; subtitle of the chart

xlab

string; x-axis title

ylab

string; y-axis title

Value

a ggplot of boxplots for an indicator for containing values for multiple areas over time

See Also

Other quick charts: compare_areas(), compare_indicators(), map(), overview(), population(), trends()

Examples

library(dplyr)
df <- create_test_data()

df_box <- df %>%
        filter(AreaType == "Local") %>%
        arrange(IndicatorName) %>%
        mutate(Timeperiod = rep(c("2011", "2012", "2013", "2014", "2015", "2016"),
                                each = 100))
p <- box_plots(df_box,
               timeperiod = Timeperiod,
               value = Value,
               title = "Title of chart",
               subtitle = "Boxplot over time",
               ylab = "Proportion (%)")

PublicHealthEngland/fingertipscharts documentation built on Sept. 21, 2023, 10:31 p.m.