plot_recent_fac_increases: Plot facilities with recent COVID-19 metric increases

View source: R/plot_recent_fac_increases.R

plot_recent_fac_increasesR Documentation

Plot facilities with recent COVID-19 metric increases

Description

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.

Usage

plot_recent_fac_increases(
  scrape_df = NULL,
  metric = "Residents.Confirmed",
  plot_days = NULL,
  delta_days = 7,
  num_fac = 4,
  annotate = F,
  auto_label = F
)

Arguments

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

Value

ggplot object

Examples

## 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)


uclalawcovid19behindbars/behindbarstools documentation built on April 22, 2022, 4:08 a.m.