download_census_population.Rd
Download and load U.S. census American Community Survey 5-year summary files at the block group level, optionally including home-work commute statistics.
download_census_population(dir, state, year = 2019,
include_margins = FALSE, include_commutes = FALSE, counties = NULL,
tracts = NULL, blockgroups = NULL, overwrite = FALSE, verbose = TRUE)
Directory in which to save the file(s).
Name, abbreviation, or FIPS code of the state.
4 digit year, between 2009 and the most recent year.
Logical; if TRUE
, will save and include estimate margins or error, which is a
data.frame
with the same dimensions as the estimates data.frame
.
Logical; if TRUE
, will download the
Longitudinal Employer-Household Dynamics (LEHD)
Origin-Destination Employment Statistics (LODES)
data for the state and block groups within selected tracts.
A vector of counties, tracts, or block group GEOIDs within the specified state to filter block groups for (block groups within the specified counties or tracts, or matching the specified block group GEOID). Only one can be specified (lower levels overwrite higher levels). Defaults to all block groups.
Logical; if TRUE
, will remove any existing files before downloading and saving new versions.
Logical; if FALSE
, will not print status messages.
A list with at least an estimates
entry, and optionally margins
and/or commutes
entries. The extimates
and margins
entries are data.frame
s with block groups in rows,
population variables in columns, and person counts in cells. The commutes
entry is a sparse matrix with
home block groups in rows, work block groups in columns, and job counts in cells (all jobs, summed across blocks).
if (FALSE) {
download_census_population(".", "va")
}