calc_aggregate_counts: Aggregate UCLA and MP data to get a more recent accurate...

View source: R/calc_aggregate_counts.R

calc_aggregate_countsR Documentation

Aggregate UCLA and MP data to get a more recent accurate count of COVID variables

Description

Reads the UCLA and MP/AP dataset aggregates counts for states for most recent data after a given date cutoff and reports either state level data or national data. States include values for the 50 state DOCs, Federal for BOP prisons, ICE detention centers, and incarcerated individuals under the administration of the District of Columbia DOC. If both UCLA and MP report a value for a state the larger value for is taken.

Usage

calc_aggregate_counts(
  date_cutoff = DATE_CUTOFF,
  window = 31,
  ucla_only = FALSE,
  state = FALSE,
  sub_vax = TRUE,
  all_dates = FALSE,
  week_grouping = TRUE,
  only_prison = TRUE
)

Arguments

date_cutoff

date, the earliest date of acceptable data to pull from if all_dates is FALSE for .Confirmed and .Deaths variables

window

integer, the day range of acceptable UCLA data to pull from if all_dates is FALSE for all variables EXCEPT .Confirmed and .Deaths

ucla_only

logical, only consider data from UCLA

state

logical, return state level data

sub_vax

logical, add variable for Residents.Initiated, equal to Residents.Completed, where Resident.Initiated is missing, by state, measure, and date when all_dates == T

all_dates

logical, get time series data rather than just latest counts

week_grouping

logical, use weekly grouping for past data? else monthly

only_prison

logical, whether to only include Prison, Federal, and ICE web groups (state prisons, federal prisons, and ICE detention)

Value

data frame with aggregated counts at state or national level

Examples

## Not run: 
calc_aggregate_counts()

## End(Not run)
calc_aggregate_counts(state = TRUE, all_dates = TRUE)

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