read_scrape_data: Read data extracted by webscraper

View source: R/read_scrape_data.R

read_scrape_dataR Documentation

Read data extracted by webscraper

Description

Reads either time series or latest data from the web scraper runs.

Usage

read_scrape_data(
  all_dates = FALSE,
  date_cutoff = DATE_CUTOFF,
  window = 31,
  window_pop = 90,
  coalesce_func = sum_na_rm,
  drop_noncovid_obs = TRUE,
  debug = FALSE,
  state = NULL,
  wide_data = TRUE
)

Arguments

all_dates

logical, get all data from all dates recorded by webscraper

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 data to pull from if all_dates is FALSE for all variables EXCEPT .Confirmed and .Deaths

window_pop

int, how far to go back (in days) to look for values from a given facility to populate NAs in Residents.Population

coalesce_func

function, how to combine redundant rows

drop_noncovid_obs

logical, drop rows missing all COVID variables

debug

logical, print debug statements on number of rows maintained in

state

character vector, states to limit data to

wide_data

logical, return wide data as opposed to long

Value

dataframe with scraped data

Examples

## Not run: 
read_scrape_data(all_dates = FALSE)

## End(Not run)
read_scrape_data(all_dates = TRUE, state = "Wyoming")


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