get_vat: get_vat

Description Usage Arguments Value Examples

View source: R/get_vat.R

Description

Function to get vote count data aggregated by strata, geographic region, or party estimates from the AP voter analysis tool

Usage

1
2
3
4
5
6
7
8
get_vat(
  key = Sys.getenv("apelex_api_key"),
  test = FALSE,
  report = c("CountyGeoStrata", "CountyPartyStrata", "CountyPartyStrataEstimates",
    "CountyGeoStrataEstimates", "CountyPartyStatewideEstimates",
    "CountyGeoStatewideEstimates"),
  date = Sys.Date()
)

Arguments

key

Supplied API key

test

TRUE/FALSE. Whether to use test data (TRUE) or production data (FALSE). Defaults to FALSE.

report

The type of VAT report to get data from. Options include: CountyGeoStrata, CountyPartyStrataEstimates, CountyGeoStrataEstimates, CountyPartyStatewideEstimates, CountyGeoStatewideEstimates

date

date of the election in ISO format, e.g. "2020-02-03". Defaults to Sys.Date()

Value

Returns a tidy dataframe of VAT results

Examples

1
vat_test <- get_vat(report = "CountyGeoStrata", key = "key = Sys.getenv("apelex_api_key"), date = "2020-02-03)

willdebras/apelex documentation built on Oct. 10, 2020, 11:48 p.m.