View source: R/plot_recent_fac_increases.R
plot_recent_fac_increases | R Documentation |
Creates time series plots showing trends for facilities with the steepest recent increases in a given metric, formatted according to the style guide. Returns a ggplot object, so additional layers can be added, per the examples.
plot_recent_fac_increases( scrape_df = NULL, metric = "Residents.Confirmed", plot_days = NULL, delta_days = 7, num_fac = 4, annotate = F, auto_label = F )
scrape_df |
data frame with scraped data |
metric |
character string of the metric to plot |
plot_days |
integer, number of days to plot |
delta_days |
integer, number of days to calculate increase over |
num_fac |
integer, number of facilities to plot |
annotate |
logical, whether to include text annotations for most recent value |
auto_label |
logical, whether to label plot title, subtitle, axes based on behindbarstools::get_metric_description |
ggplot object
## Not run: plot_recent_fac_increases() plot_recent_fac_increases(metric = "Residents.Deaths", plot_days = 30, num_fac = 3) ## End(Not run) ## Not run: plot_recent_fac_increases() + labs(y = "Cases Among Incarcerated People") + ylim(0, 3000) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.