Learn R Programming

wru (version 0.1-1)

getCensusData: Title return Multilevel Census Data download function.

Description

getCensusData returns a Census data obj for a state.

Usage

getCensusData(key, states, demo = FALSE)

Arguments

key
A required character object. Must contain user's Census API key, which can be requested here.
states
which states to extract Census data for, e.g. c("NJ", "NY").
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.

Value

Output will be an census object of class which is a list consist of state, demo, county level census, tract level census and block level census. Have the census data available could make census.helper.api runs more efficient.

Examples

Run this code
## Not run: getCensusData(key = "...", states = c("NJ", "DE"), demo = TRUE)

Run the code above in your browser using DataLab