Arguments
key
A required character object. Must contain user's Census API
key, which can be requested here. voters
An object of class data.frame. Must contain field(s)
named county, tract, and/or block
specifying geolocation. These should be character variables that match up with
U.S. Census categories. County should be three characters (e.g., "031" not "31"),
tract should be six characters, and block should be four characters.
states
A character vector specifying which states to extract
Census data for, e.g. c("NJ", "NY"). Default is "all", which extracts
Census data for all states contained in user-input data.
geo
A character object specifying what aggregation level to use.
Use "county", "tract", or "block". Default is "tract".
Warning: extracting block-level data takes very long.
demo
A TRUE/FALSE object indicating whether to condition on
demographics (i.e., age and sex) or not. If TRUE, function will return
Pr(Geolocation, Age, Sex | Race). If FALSE, function wil return
Pr(Geolocation | Race). Default is FALSE.
census.data
A optional census object holding census data that is already
provided. If missing, function will retrive the census data online.