View source: R/read.concat.states.R
read.concat.states | R Documentation |
Read the unzipped csv files of estimates and MOE (margin of error) for American Community Survey (ACS) 5-year summary file data obtained from US Census FTP site. These State-specific csv files are combined into a single national result for each Census data table.
read.concat.states(
tables,
mystates,
geo,
needed,
folder = getwd(),
output.path,
end.year = acsdefaultendyearhere_func(),
save.files = TRUE,
sumlevel = "both",
testing = FALSE,
dt = TRUE,
silent = FALSE
)
tables |
Optional character vector of table numbers needed such as 'B01001', but default is all tables from each sequence file found. |
mystates |
Optional character vector of 2-character state abbreviations. Default is all states for which matching filenames are found in folder. |
geo |
Optional table of geographic identifiers that elsewhere would be merged with data here.
If provided, it is used here to look up data file length, based on state abbrev's list. See |
needed |
Optional data.frame specifying which variables to keep from each table. Default is to keep all. See |
folder |
Default is current working directory. Specifies where the csv files are to be found. |
output.path |
Default is whatever the parameter |
end.year |
Optional, specifies end year of 5-year summary file. |
save.files |
Default is TRUE, in which case it saves each resulting table/ data file on disk. |
sumlevel |
Default is "both". Specifies if "tracts" or "blockgroups" or "both" should be returned. |
testing |
Default is FALSE. If TRUE, prints filenames but does not unzip them, and prints more messages. |
dt |
Optional logical, TRUE by default, specifies whether data.table::fread should be used instead of read.csv |
silent |
Default is FALSE. Whether to send progress info to standard output. |
This can use read.csv (takes about 1 minute total for one table, all states, est and moe). It can use data.table::fread (default method), which is faster.
Returns a list of data.frames, where each element of the list is one ACS table, such as table B01001.
get.acs()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.