Title: | Extract Decennial Census and American Community Survey Data |
---|---|
Description: | Download summary files from Census Bureau <https://www2.census.gov/> and extract data, in particular high resolution data at block, block group, and tract level, from decennial census and American Community Survey 1-year and 5-year estimates. |
Authors: | Guanglai Li |
Maintainer: | Guanglai Li <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.6.7 |
Built: | 2024-11-09 04:53:06 UTC |
Source: | https://github.com/gl-li/totalcensus |
convert fips codes to names of a geographies
convert_fips_to_names( FIPs, states = NULL, geo_header = "STATE", in_states = NULL )
convert_fips_to_names( FIPs, states = NULL, geo_header = "STATE", in_states = NULL )
FIPs |
string vector of fips code such as c("021", "002") |
states |
string vector of state abbreviations having same length as FIPs |
geo_header |
string, taking values of "STATE", "COUNTY", "PLACE", "COUSUB" or "CBSA". |
in_states |
which states are these FIPs generated from. Use state abbrevations or "US" for national. Vector of unique states. |
vector of names corresponding to FIPs and states
aaa <- convert_fips_to_names(c("11", "44")) # [1] "DC" "RI" bbb <- convert_fips_to_names(c("001", "013"), states = c("RI", "MA"), geo_header = "COUNTY") # [1] "Bristol County" "Hampden County"
aaa <- convert_fips_to_names(c("11", "44")) # [1] "DC" "RI" bbb <- convert_fips_to_names(c("001", "013"), states = c("RI", "MA"), geo_header = "COUNTY") # [1] "Bristol County" "Hampden County"
List of geographic headers used in 2005 ACS 1 year survey
dict_acs_geoheader_2005_1year
dict_acs_geoheader_2005_1year
A data.table with 35 rows and 4 variables
reference of the geoheader
description of the geoheader
starting position of the geoheader in geography file
ending position of the geoheader in geography file
2005 ACS Summary File technical documentation, page 12.
List of geographic headers used in 2006 - 2008 ACS 1 year survey
dict_acs_geoheader_2006_2008_1year
dict_acs_geoheader_2006_2008_1year
A data.table with 51 rows and 4 variables
reference of the geoheader
description of the geoheader
starting position of the geoheader in geography file
ending position of the geoheader in geography file
2008 ACS Summary File technical documentation, page 13.
List of geographic headers in 2009 ACS 1 year survey
dict_acs_geoheader_2009_1year
dict_acs_geoheader_2009_1year
A data.table with 50 rows and 4 variables
reference of the geoheader
description of the geoheader
starting position of the geoheader in geography file
ending position of the geoheader in geography file
2016 ACS Summary File technical documentation, page 11.
List of geographic headers used in ACS 5 year survey ending 2009
dict_acs_geoheader_2009_5year
dict_acs_geoheader_2009_5year
A data.table with 51 rows and 4 variables
reference of the geoheader
description of the geoheader
starting position of the geoheader in geography file
ending position of the geoheader in geography file
2009 ACS Summary File technical documentation, page 12.
List of geographic headers used in 2010 ACS 1 and 5 year surveys
dict_acs_geoheader_2010
dict_acs_geoheader_2010
A data.table with 53 rows and 4 variables
reference of the geoheader
description of the geoheader
starting position of the geoheader in geography file
ending position of the geoheader in geography file
2016 ACS Summary File technical documentation, page 11.
List of geographic headers used in American Community Survey since 2011
dict_acs_geoheader_2011_now
dict_acs_geoheader_2011_now
A data.table with 53 rows and 4 variables
reference of the geoheader
description of the geoheader
starting position of the geoheader in geography file
ending position of the geoheader in geography file
2016 ACS Summary File technical documentation, page 10.
List of geographic components used in ACS 1 year surverys
dict_acs1_geocomponent
dict_acs1_geocomponent
A data.table with 28 rows and 9 variables:
code for the geocomponent, such as "01" and "M3"
description of the geographic component
wheather a geocomponent available in state files since 2009
wheather a geocomponent available in state files in 2007 and 2008
wheather a geocomponent available in state files in 2005 and 2006
wheather a geocomponent available in national files since 2009
wheather a geocomponent available in national files in 2007 and 2008
wheather a geocomponent available in national files in 2006
wheather a geocomponent available in national files in 2005
List of summary levels used in ACS 1 year surverys
dict_acs1_summarylevel
dict_acs1_summarylevel
A data.table with 23 rows and 5 variables
code of summary level
description of summary level
wheather a summary level available in state files since 2006
wheather a summary level available in state files in 2005
wheather a summary level available in national files since 2005
List of summary levels used in ACS 1 year surverys
dict_acs1_table
dict_acs1_table
A data.table with 1811 rows and 16 variables:
table number such as "C27013"
description of the table
whether the table is available in 2019
whether the table is available in 2018
whether the table is available in 2017
whether the table is available in 2016
whether the table is available in 2015
whether the table is available in 2014
whether the table is available in 2013
whether the table is available in 2012
whether the table is available in 2011
whether the table is available in 2010
whether the table is available in 2009
whether the table is available in 2008
whether the table is available in 2007
whether the table is available in 2006
whether the table is available in 2005
universe of the table
List of geographic components used in ACS 5 year surverys
dict_acs5_geocomponent
dict_acs5_geocomponent
A data.table with 19 rows and 4 variables:
code for the geocomponent, such as "01" and "M3"
description of the geographic component
wheather a geocomponent available in state files since 2009
wheather a geocomponent available in national files since 2009
List of summary levels used in ACS 5 year surveys
dict_acs5_summarylevel
dict_acs5_summarylevel
A data.table with 87 rows and 8 variables
code of summary level
description of summary level
wheather a summary level available in state files since 2013
wheather a summary level available in state files in 2012
wheather a summary level available in state files in 2009 - 2011
wheather a summary level available in national files since 2011
wheather a summary level available in national files in 2010
wheather a summary level available in national files in 2009
generated from lookup datasets of years 2009 - 2016
List of summary levels used in ACS 5 year surverys
dict_acs5_table
dict_acs5_table
A data.table with 1174 rows and 14 variables:
table number such as "C27013"
description of the table
whether the table is available in 2021
whether the table is available in 2020
whether the table is available in 2019
whether the table is available in 2018
whether the table is available in 2017
whether the table is available in 2016
whether the table is available in 2015
whether the table is available in 2014
whether the table is available in 2013
whether the table is available in 2012
whether the table is available in 2011
whether the table is available in 2010
whether the table is available in 2009
universe of the table
This dataset contains all available geographic components and codes.
dict_all_geocomponent_2000 dict_all_geocomponent_2000
dict_all_geocomponent_2000 dict_all_geocomponent_2000
A data.table with 99 rows and 2 variables:
code for the geocomponent, such as "01" and "M3"
description of the geographic component
A data.table with 99 rows and 2 variables:
code for the geocomponent, such as "01" and "M3"
description of the geographic component
2000 Census Summary File 1 technical documentation page 7-15
This dataset contains all available geographic components and codes.
dict_all_geocomponent_2010 dict_all_geocomponent_2010
dict_all_geocomponent_2010 dict_all_geocomponent_2010
A data.table with 114 rows and 2 variables:
code for the geocomponent, such as "01" and "M3"
description of the geographic component
A data.table with 114 rows and 2 variables:
code for the geocomponent, such as "01" and "M3"
description of the geographic component
2010 Census Summary File 1 technical documentation page 6-15
List of all summary levels
dict_all_summarylevel
dict_all_summarylevel
A data.table with 216 rows and 2 variables
code of summary level
description of summary level
This dataset contains Metropolitan Statistical Area/Micropolitan
Statistical Area CBSA code and title, plus associated metrodivision, CSA, state,
and county code. Search for CBSA with function search_cbsa
.
data("dict_cbsa")
data("dict_cbsa")
A data.table with 1882 rows and 12 variables:
CBSA code
CBSA title
full name of the state. A cbsa could include multiple states
county or county equivalent
code of the CSA to which the CBSA belongs
CSA title
metro division code
metro division title
is the CBSA a metropolitan or a micropolitan statistic area
FIPS of the state
FIPS of the county
is the counry a central or outlying county in the CBSA
This dataset contains the geographic components and codes used in
Census 2000 summary file 1. Search geographic components
with function search_geocomponents
.
dict_decennial_geocomponent_2000
dict_decennial_geocomponent_2000
A data.table with 98 rows and 4 variables:
code for the geocomponent, such as "01" and "M3"
description of the geographic component
wheather the geocomponent available in state files
wheather the geocomponent available in national files
2000 Census Summary File 1 technical documentation page 7-15
This dataset contains the geographic components and codes used in
Census 2010 summary file 1 (with urban/rural update). Search geographic components
with function search_geocomponents
.
dict_decennial_geocomponent_2010
dict_decennial_geocomponent_2010
A data.table with 96 rows and 4 variables:
code for the geocomponent, such as "01" and "M3"
description of the geographic component
wheather the geocomponent available in state files
wheather the geocomponent available in national files
2010 Census Summary File 1 technical documentation page 6-15
This dataset has the complete list of geographic header
references and their discription used in Census 2000 summary file 1.
Search the dataset with function search_geoheaders
.
dict_decennial_geoheader_2000
dict_decennial_geoheader_2000
A data.table with 83 rows and 4 variables
reference of the geoheader record
description of the geoheader record field
starting position of the geoheader in the record
ending position of the geoheader in the record
2000 Census Summary File 1 technical documentation page 2-7
This dataset has the complete list of geographic header
references and their discription used in Census 2010 summary file 1 (with
urban/rural update). Search the dataset with function search_geoheaders
.
dict_decennial_geoheader_2010
dict_decennial_geoheader_2010
A data.table with 101 rows and 4 variables
reference of the geoheader record
description of the geoheader record field
starting position of the geoheader in the record
ending position of the geoheader in the record
2010 Census Summary File 1 technical documentation page 2-8
This data contains summary levels and codes used in census 2000
summary file 1. Search with function search_summarylevels
.
dict_decennial_summarylevel_2000
dict_decennial_summarylevel_2000
A data.table with 114 rows and 4 variables
code of summary level
description of summary level
wheather the summary level available in state files
wheather the summary level available in national files
2000 Census Summary File 1 technical documentation page 4-1.
This data contains summary levels and codes used in census 2010
summary file 1 (with urban/rural update). Search with function search_summarylevels
.
dict_decennial_summarylevel_2010
dict_decennial_summarylevel_2010
A data.table with 165 rows and 4 variables
code of summary level
description of summary level
wheather the summary level available in state files
wheather the summary level available in national files
2010 Census Summary File 1 technical documentation page 4-16 state summary file with urban/rural update
This dataset contains all census tables in census 2000 summary file 1.
dict_decennial_table_2000
dict_decennial_table_2000
A data.table with 286 rows and 4 variables:
table number such as "H1", "PCT22G"
description of the table
universe of the data
reference code such as "H0010", "PCT022G"
2000 Census Summary File 1 technical documentation all across chapter 5.
This dataset contains all census tables in census 2010 summary file 1 (with urban/rural update).
dict_decennial_table_2010
dict_decennial_table_2010
A data.table with 333 rows and 4 variables:
table number such as "H1", "PCT22G"
description of the table
universe of the data
reference code such as "H0010", "PCT022G"
2010 Census Summary File 1 technical documentation chapter 5.
This dataset contains a list of FIPS of states, counties,
county subdivisions, places, consolidated cities, and their names and summary
levels as well as full name and abbreviation of state. It does NOT contain
FIPS of many small areas. Search for FIPS with function
search_fips
.
data("dict_fips")
data("dict_fips")
A data.table with 43934 rows and 9 variables:
full name of a state such as "Alabama"
abbreviation of a state such as "AL"
FIPS code of the state
summary level of the entry in the row
FIPS code of county
FIPS of COUnty SUBdivision
FIPS code of place
FIPS code of CONsolidated CITy
name of the entry in the row
Download decennial census and ACS 5-year and 1-year data from United States Census bureau. It also download generated data from Census 2010 if not exist.
download_census(survey, year, states = c(states_DC, "US", "PR"))
download_census(survey, year, states = c(states_DC, "US", "PR"))
survey |
Which survey to download from, "decennial", "acs5year", , "acs1year", or "redistricting". |
year |
year or ending year of the survey |
states |
vector of abbreviations of states such as c("MA", "RI") |
This function downloads data generated from Census 2010 from Census 2010.
download_generated_data()
download_generated_data()
There is slightly difference in the lookup tables of each year.
lookup_acs1year_2005
lookup_acs1year_2005
A data.table with 27246 rows and 7 variables
sequence number of segment data files, from "0001" to "0166"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
There is slightly difference in the lookup tables of each year.
lookup_acs1year_2006
lookup_acs1year_2006
A data.table with 27986 rows and 7 variables
sequence number of segment data files, from "0001" to "0166"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
There is slightly difference in the lookup tables of each year.
lookup_acs1year_2007
lookup_acs1year_2007
A data.table with 29709 rows and 7 variables
sequence number of segment data files, from "0001" to "0166"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
There is slightly difference in the lookup tables of each year.
lookup_acs1year_2008
lookup_acs1year_2008
A data.table with 34403 rows and 7 variables
sequence number of segment data files, from "0001" to "0166"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
There is slightly difference in the lookup tables of each year.
lookup_acs1year_2009
lookup_acs1year_2009
A data.table with 34408 rows and 7 variables
sequence number of segment data files, from "0001" to "0166"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
There is slightly difference in the lookup tables of each year.
lookup_acs1year_2010
lookup_acs1year_2010
A data.table with 35240 rows and 7 variables
sequence number of segment data files, from "0001" to "0166"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
There is slightly difference in the lookup tables of each year.
lookup_acs1year_2011
lookup_acs1year_2011
A data.table with 34454 rows and 6 variables
sequence number of segment data files, from "0001" to "0165"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
There is slightly difference in the lookup tables of each year.
lookup_acs1year_2012
lookup_acs1year_2012
A data.table with 34394 rows and 6 variables
sequence number of segment data files, from "0001" to "0165"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
There is slightly difference in the lookup tables of each year.
lookup_acs1year_2013
lookup_acs1year_2013
A data.table with 32752 rows and 7 variables
sequence number of segment data files, from "0001" to "0165"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
There is slightly difference in the lookup tables of each year.
lookup_acs1year_2014
lookup_acs1year_2014
A data.table with 31711 rows and 6 variables
sequence number of segment data files, from "0001" to "0165"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
There is slightly difference in the lookup tables of each year.
lookup_acs1year_2015
lookup_acs1year_2015
A data.table with 31751 rows and 7 variables
sequence number of segment data files, from "0001" to "0165"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
There is slightly difference in the lookup tables of each year.
lookup_acs1year_2016
lookup_acs1year_2016
A data.table with 31835 rows and 7 variables
sequence number of segment data files, from "0001" to "0166"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
There is slightly difference in the lookup tables of each year.
lookup_acs1year_2017
lookup_acs1year_2017
A data.table with 33749 rows and 7 variables
sequence number of segment data files, from "0001" to "0166"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
There is slightly difference in the lookup tables of each year.
lookup_acs1year_2018
lookup_acs1year_2018
A data.table with 35502 rows and 7 variables
sequence number of segment data files, from "0001" to "0166"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
There is slightly difference in the lookup tables of each year.
lookup_acs1year_2019
lookup_acs1year_2019
A data.table with 35527 rows and 7 variables
sequence number of segment data files, from "0001" to "0166"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
ACS 5-year 2009 file segment and table lookup data
lookup_acs5year_2009
lookup_acs5year_2009
A data.table with 21207 rows and 7 variables
sequence number of segment data files, from "0001" to "0122"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
restrictions applied the the table_content
table number such as "B01001"
description of table. A table has multiple columns (table_content)
the universe of the data
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
ACS 5-year 2010 file segment and table lookup data
lookup_acs5year_2010
lookup_acs5year_2010
A data.table with 21487 rows and 7 variables
sequence number of segment data files, from "0001" to "0122"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
restrictions applied the the table_content
table number such as "B01001"
description of table. A table has multiple columns (table_content)
the universe of the data
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
ACS 5-year 2011 file segment and table lookup data
lookup_acs5year_2011
lookup_acs5year_2011
A data.table with 21038 rows and 7 variables
sequence number of segment data files, from "0001" to "0122"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
restrictions applied the the table_content
table number such as "B01001"
description of table. A table has multiple columns (table_content)
the universe of the data
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
ACS 5-year 2012 file segment and table lookup data
lookup_acs5year_2012
lookup_acs5year_2012
A data.table with 22527 rows and 7 variables
sequence number of segment data files, from "0001" to "0122"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
restrictions applied the the table_content
table number such as "B01001"
description of table. A table has multiple columns (table_content)
the universe of the data
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
ACS 5-year 2013 file segment and table lookup data
lookup_acs5year_2013
lookup_acs5year_2013
A data.table with 22711 rows and 7 variables
sequence number of segment data files, from "0001" to "0122"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
restrictions applied the the table_content
table number such as "B01001"
description of table. A table has multiple columns (table_content)
the universe of the data
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
ACS 5-year 2014 file segment and table lookup data
lookup_acs5year_2014
lookup_acs5year_2014
A data.table with 22627 rows and 7 variables
sequence number of segment data files, from "0001" to "0122"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
restrictions applied the the table_content
table number such as "B01001"
description of table. A table has multiple columns (table_content)
the universe of the data
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
ACS 5-year 2015 file segment and table lookup data
lookup_acs5year_2015
lookup_acs5year_2015
A data.table with 22910 rows and 7 variables
sequence number of segment data files, from "0001" to "0122"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
restrictions applied the the table_content
table number such as "B01001"
description of table. A table has multiple columns (table_content)
the universe of the data
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
ACS 5-year 2016 file segment and table lookup data
lookup_acs5year_2016
lookup_acs5year_2016
A data.table with 22958 rows and 7 variables
sequence number of segment data files, from "0001" to "0122"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
restrictions applied the the table_content
table number such as "B01001"
description of table. A table has multiple columns (table_content)
the universe of the data
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
ACS 5-year 2017 file segment and table lookup data
lookup_acs5year_2017
lookup_acs5year_2017
A data.table with 25070 rows and 7 variables
sequence number of segment data files, from "0001" to "0122"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
restrictions applied the the table_content
table number such as "B01001"
description of table. A table has multiple columns (table_content)
the universe of the data
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
ACS 5-year 2018 file segment and table lookup data
lookup_acs5year_2018
lookup_acs5year_2018
A data.table with 26996 rows and 7 variables
sequence number of segment data files, from "0001" to "0122"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
restrictions applied the the table_content
table number such as "B01001"
description of table. A table has multiple columns (table_content)
the universe of the data
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
ACS 5-year 2019 file segment and table lookup data
lookup_acs5year_2019
lookup_acs5year_2019
A data.table with 27039 rows and 7 variables
sequence number of segment data files, from "0001" to "0122"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
restrictions applied the the table_content
table number such as "B01001"
description of table. A table has multiple columns (table_content)
the universe of the data
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
ACS 5-year 2020 file segment and table lookup data
lookup_acs5year_2020
lookup_acs5year_2020
A data.table with 27850 rows and 7 variables
sequence number of segment data files, from "0001" to "0122"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
restrictions applied the the table_content
table number such as "B01001"
description of table. A table has multiple columns (table_content)
the universe of the data
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
ACS 5-year 2021 file segment and table lookup data
lookup_acs5year_2021
lookup_acs5year_2021
A data.table with 27886 rows and 7 variables
sequence number of segment data files, from "0001" to "0122"
description of columns in a table
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
restrictions applied the the table_content
table number such as "B01001"
description of table. A table has multiple columns (table_content)
the universe of the data
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.
This dataset includes all data fields of data files in census 2000
summary file 1. Fucntion search_tablecontents
searches content in this dataset.
lookup_decennial_2000
lookup_decennial_2000
A data.table with 8321 rows and 6 variables:
sequence number of segment data files, from 1 to 48
description of columns in a decennial table
reference of table content, such as "PCT0240019"
table number such as "H1", "PCT22G"
description of table, which has many table_content
the universe of the decennial data
2000 Census Summary File 1 technical documentation chapter 7.
This dataset includes all data fields of data files in census 2010
summary file 1 (with urban/rural update). Fucntion search_tablecontents
searches content in this dataset.
lookup_decennial_2010
lookup_decennial_2010
A data.table with 9199 rows and 6 variables:
sequence number of segment data files, from 1 to 48
description of columns in a decennial table
reference of table content, such as "PCT0240019"
table number such as "H1", "PCT22G"
description of table, which has many table_content
the universe of the decennial data
2010 Census Summary File 1 technical documentation chapter 6.
This function retrieves data from summary file of ACS 1-year estimates. In addition to selected geographic headers and table contents, it also returns total population and coordinates of selected geographic areas, as well as summary levels and geographic components.
read_acs1year( year, states, table_contents = NULL, areas = NULL, geo_headers = NULL, summary_level = NULL, geo_comp = "total", with_margin = FALSE, dec_fill = NULL, show_progress = TRUE )
read_acs1year( year, states, table_contents = NULL, areas = NULL, geo_headers = NULL, summary_level = NULL, geo_comp = "total", with_margin = FALSE, dec_fill = NULL, show_progress = TRUE )
year |
year of the estimate |
states |
vector of state abbreviations, such as "IN" and c("MA", "RI"). |
table_contents |
selected references of contents in census tables. Users
can choose a name for each reference, such as in
c("abc = B01001_009", "fff = B00001_001").
Try to make names meaningful. To find the references of table contents
of interest, search with function |
areas |
For metro area, in the format like "New York metro".
For county, city, or town, must use the exact name as those in
|
geo_headers |
vector of references of selected geographci headers to be
included in the return. Search with |
summary_level |
select which summary level to keep, default to keep all.
It takes strings including "state", "county", "county subdivision",
"place", "tract", "block group", and "block" for the most common
levels. It also take code. Search all codes with
|
geo_comp |
select which geographic component to keep, "*" to keep every
geo-component, "total" for "00", "urban" for "01", "urbanized area"
for "04", "urban cluster" for "28", "rural" for "43". Others should
input code, which can be found with function
|
with_margin |
read also margin of error in addition to estimate |
dec_fill |
whether to fill geo_headers codes with data from decennial census. The #' codes in ACS summary file are incomplete. "dec2010" using decennial census 2010 data. |
show_progress |
whether to show progress in fread() |
A data.table of selected data.
## Not run: # read summary data using areas of selected cities aaa <- read_acs1year( year = 2016, states = c("UT", "RI"), table_contents = c("male = B01001_002", "female = B01001_026"), areas = c("Salt Lake City city, UT", "Providence city, RI", "PLACE = RI19180"), summary_level = "place", with_margin = TRUE ) # read data using geoheaders - all major counties bbb <- read_acs1year( year = 2015, states = c("UT", "RI"), table_contents = c("male = B01001_002", "female = B01001_026"), geo_headers = c("COUNTY"), summary_level = "county", with_margin = TRUE ) ## End(Not run)
## Not run: # read summary data using areas of selected cities aaa <- read_acs1year( year = 2016, states = c("UT", "RI"), table_contents = c("male = B01001_002", "female = B01001_026"), areas = c("Salt Lake City city, UT", "Providence city, RI", "PLACE = RI19180"), summary_level = "place", with_margin = TRUE ) # read data using geoheaders - all major counties bbb <- read_acs1year( year = 2015, states = c("UT", "RI"), table_contents = c("male = B01001_002", "female = B01001_026"), geo_headers = c("COUNTY"), summary_level = "county", with_margin = TRUE ) ## End(Not run)
This function retrieves data from summary file of ACS 5-year estimates. In addition to selected geographic headers and table contents, it also returns total population and coordinates of selected geographic areas, as well as summary levels and geographic components.
read_acs5year( year, states, table_contents = NULL, areas = NULL, geo_headers = NULL, summary_level = NULL, geo_comp = "total", with_margin = FALSE, dec_fill = NULL, show_progress = TRUE )
read_acs5year( year, states, table_contents = NULL, areas = NULL, geo_headers = NULL, summary_level = NULL, geo_comp = "total", with_margin = FALSE, dec_fill = NULL, show_progress = TRUE )
year |
ending year of the 5-year estimate |
states |
vector of state abbreviations, such as "IN" and c("MA", "RI"). |
table_contents |
selected references of contents in census tables. Users
can choose a name for each reference, such as in
c("abc = B01001_009", "fff = B00001_001").
Try to make names meaningful. To find the references of table contents
of interest, search with function |
areas |
For metro area, in the format like "New York metro".
For county, city, or town, must use the exact name as those in
|
geo_headers |
vector of references of selected geographci headers to be
included in the return, like "COUNTY" or c("PLACE", "CBSA").
Search with |
summary_level |
select which summary level to keep, default to keep all.
It takes string including "state", "county", "county subdivision",
"place", "tract", "block group", and "block" for the most common
levels. It also take code. Search all codes with
|
geo_comp |
select which geographic component to keep, "*" to keep every
geo-component, "total" for "00", "urban" for "01", "urbanized area"
for "04", "urban cluster" for "28", "rural" for "43". Others should
input code, which can be found with function
|
with_margin |
read also margin of error in addition to estimate |
dec_fill |
whether to fill geo_headers codes with data from decennial census. The codes in ACS summary file are incomplete. "dec2010" using decennial census 2010 data |
show_progress |
whether to show progress in fread() |
A data.table of selected data.
## Not run: # read data using areas aaa <- read_acs5year( year = 2015, states = c("UT", "RI"), table_contents = c( "white = B02001_002", "black = B02001_003", "asian = B02001_005" ), areas = c( "Lincoln town, RI", "Salt Lake City city, UT", "Salt Lake City metro", "Kent county, RI", "COUNTY = UT001", "PLACE = UT62360" ), summary_level = "block group", with_margin = TRUE ) # read data using geoheaders bbb <- read_acs5year( year = 2015, states = c("UT", "RI"), table_contents = c("male = B01001_002", "female = B01001_026"), geo_headers = "PLACE", summary_level = "block group" ) ## End(Not run)
## Not run: # read data using areas aaa <- read_acs5year( year = 2015, states = c("UT", "RI"), table_contents = c( "white = B02001_002", "black = B02001_003", "asian = B02001_005" ), areas = c( "Lincoln town, RI", "Salt Lake City city, UT", "Salt Lake City metro", "Kent county, RI", "COUNTY = UT001", "PLACE = UT62360" ), summary_level = "block group", with_margin = TRUE ) # read data using geoheaders bbb <- read_acs5year( year = 2015, states = c("UT", "RI"), table_contents = c("male = B01001_002", "female = B01001_026"), geo_headers = "PLACE", summary_level = "block group" ) ## End(Not run)
This function retrieves data from summary file 1 (with urban/rural update) of decennial censuses. In addition to selected geographic headers and table contents, it also returns total population and coordinates of selected geographic areas, as well as summary levels and geographic components.
read_decennial( year, states, table_contents = NULL, areas = NULL, geo_headers = NULL, summary_level = NULL, geo_comp = "total", show_progress = TRUE )
read_decennial( year, states, table_contents = NULL, areas = NULL, geo_headers = NULL, summary_level = NULL, geo_comp = "total", show_progress = TRUE )
year |
year of the decennial census |
states |
vector of state abbreviations, for example "IN" or c("MA", "RI"). |
table_contents |
selected references of contents in census tables. Users
can choose a name for each reference, such as in
c("abc = PCT012F139", "fff = P0030008", "rural_p = P0020005").
Try to make names meaningful. To find the references of table contents
of interest, search with function |
areas |
For metro area, in the format like "New York metro".
For county, city, or town, must use the exact name as those in
|
geo_headers |
vector of references of selected geographci headers to be
included in the return. Search with |
summary_level |
select which summary level to keep, default to keep all. It takes strings
including "state", "county", "county subdivision", "place", "tract", "block group",
and "block" for the most common levels. It also take code for level. Search all codes with
|
geo_comp |
select which geographic component to keep, "*" to keep every geo-component,
"total" for "00", "urban" for "01", "urbanized area" for "04",
"urban cluster" for "28", "rural" for "43". For all other geographic component,
use code,
which can be found with |
show_progress |
show progress of file reading if TRUE. Turn off if FALSE, which is useful in RMarkdown output. |
A data.table whose columns include the selected geoheaders and table contents plus SUMLEV, GEOCOMP, and state.
## Not run: # read one table and one area from one state aaa = read_decennial( year = 2010, states = "UT", table_contents = c("urban = P0020002", "rural = P0020005"), geo_headers = "CBSA", summary_level = "tract" ) # read multiple table contents and areas from multiple states bbb = read_decennial( year = 2010, states = c("UT", "RI"), table_contents = c("urban = P0020002", "rural = P0020005"), areas = c( "place = ut62360", "Providence city, RI", "cousub = ri41500", "cbsa = 39300" ), summary_level = "block" ) # read table contents of all county subdivisions in Providence metro ccc <- read_decennial( year = 2010, states = "US", table_contents = c("urban = P0020002", "rural = P0020005"), geo_headers = "CBSA", summary_level = "county subdivision", geo_comp = "*" ) ## End(Not run)
## Not run: # read one table and one area from one state aaa = read_decennial( year = 2010, states = "UT", table_contents = c("urban = P0020002", "rural = P0020005"), geo_headers = "CBSA", summary_level = "tract" ) # read multiple table contents and areas from multiple states bbb = read_decennial( year = 2010, states = c("UT", "RI"), table_contents = c("urban = P0020002", "rural = P0020005"), areas = c( "place = ut62360", "Providence city, RI", "cousub = ri41500", "cbsa = 39300" ), summary_level = "block" ) # read table contents of all county subdivisions in Providence metro ccc <- read_decennial( year = 2010, states = "US", table_contents = c("urban = P0020002", "rural = P0020005"), geo_headers = "CBSA", summary_level = "county subdivision", geo_comp = "*" ) ## End(Not run)
Search CBSA code of Core Based Statistical Area in dataset dict_cbsa
.
The search also returns which CSA (Combined Statistical Area) that contains
the CBSA. If the CBSA contains multiple counties, each county is returned as
a row.
search_cbsa(keywords = NULL, view = TRUE)
search_cbsa(keywords = NULL, view = TRUE)
keywords |
keywords to be searched. |
view |
display the search result with View if TRUE. |
Quite often, multiple rows are returned. It is necessary to hand pick the right one you are really looking for.
A data.table
# Change view = TRUE (default) to View the returned data. aaa <- search_cbsa("providence", view = FALSE) bbb <- search_cbsa("new york", view = FALSE) ## Not run: # view all CBSA code search_cbsa() ## End(Not run)
# Change view = TRUE (default) to View the returned data. aaa <- search_cbsa("providence", view = FALSE) bbb <- search_cbsa("new york", view = FALSE) ## Not run: # view all CBSA code search_cbsa() ## End(Not run)
Search FIPS code of a states, counties, county subdivisions, places, or
consolidated cities in dataset dict_fips
. The search also returns
summary levels.
search_fips(keywords = NULL, state = NULL, view = TRUE)
search_fips(keywords = NULL, state = NULL, view = TRUE)
keywords |
keyword to be searched in NAMES or FIPS. |
state |
abbreviation of a state. |
view |
display the search result with View if TRUE. |
Quite often, multiple rows are returned. It is necessary to hand pick the right one you are really looking for.
The function search_fips
has changed summary level 061 to 060, and
162 to 160 in search results.
The summary levels in dict_fips
are 010, 040, 050, 061, 162, and 170.
The level 061 is for Minor Civil Division (MCD)/Census County Division (CCD) (10,000+). It
does not appear in those used in decennial census and ACS surveys,
which instead have 060 for County Subdivision.
Level 061 is part of 060 and is replaced with 060 in order to use the census data. Similarly,
162 is replaced with 160.
A data.table
# Change view = TRUE (default) to View the returned data.table. # Search fips of Lincoln in Rhode Island. aaa <- search_fips("lincoln", "RI", view = FALSE) # search FIPS number in all states bbb <- search_fips("08375", view = FALSE) ## Not run: # view all fips code search_fips() ## End(Not run)
# Change view = TRUE (default) to View the returned data.table. # Search fips of Lincoln in Rhode Island. aaa <- search_fips("lincoln", "RI", view = FALSE) # search FIPS number in all states bbb <- search_fips("08375", view = FALSE) ## Not run: # view all fips code search_fips() ## End(Not run)
Search the code or content of geographic components for geo_comp
argument in function read_decennial
,
read_acs1year
, and read_acs5year
.
search_geocomponents(survey, years = NULL, keywords = NULL, view = TRUE)
search_geocomponents(survey, years = NULL, keywords = NULL, view = TRUE)
survey |
survey type, including "dec" (or "decennial"), "acs1" or "acs5". |
years |
year or ending year of the survey, can be a single year such as 2010 or a vector like 2014:2016. |
keywords |
keyword to search in code or description, in the form like "abc def dsdfsa". Rows with all words are returned. |
view |
display the search result with View if TRUE |
The most frequently used geographic components are:
00 : all geographic component 01 : urban 43 : rural
A data.table
# Change view = TRUE (default) to View the returned data. aaa <- search_geocomponents("decennial", 2010, "urban", view = FALSE) bbb <- search_geocomponents("acs5", 2011:2015, "43", view = FALSE) ## Not run: # view all geocomponents search_geocomponents("dec") search_geocomponents("acs5") ## End(Not run)
# Change view = TRUE (default) to View the returned data. aaa <- search_geocomponents("decennial", 2010, "urban", view = FALSE) bbb <- search_geocomponents("acs5", 2011:2015, "43", view = FALSE) ## Not run: # view all geocomponents search_geocomponents("dec") search_geocomponents("acs5") ## End(Not run)
Search in field reference or description of geographic header
records to find the reference of "geo_headers" argument in function read_decennial
,
read_acs1year
, and read_acs5year
.
search_geoheaders(survey, years = NULL, keywords = NULL, view = TRUE)
search_geoheaders(survey, years = NULL, keywords = NULL, view = TRUE)
survey |
survey type, including "dec" (or "decennial"), "acs1" or "acs5". |
years |
year or ending year of the survey, can be a single year such as 2010 or a vector like 2014:2016. |
keywords |
keyword to search in code or description, in the form like "abc def dsdfsa". Rows with all words are returned. |
view |
display the search result with View if TRUE |
data.table matching the search criteria
# Change view = TRUE (default) to View the returned data. # search geoheader that contains keyword "india" in decennial 2010 aaa <- search_geoheaders("decennial", 2000, "india", view = FALSE) # search for lattitude bbb <- search_geoheaders("dec", 2010, "latitu", view = FALSE) ## Not run: # browse all geoheaders in ACS i year in View() search_geoheaders("acs1") ## End(Not run)
# Change view = TRUE (default) to View the returned data. # search geoheader that contains keyword "india" in decennial 2010 aaa <- search_geoheaders("decennial", 2000, "india", view = FALSE) # search for lattitude bbb <- search_geoheaders("dec", 2010, "latitu", view = FALSE) ## Not run: # browse all geoheaders in ACS i year in View() search_geoheaders("acs1") ## End(Not run)
Search code or description of summary levels for summary_level
argument in function read_decennial
,
read_acs1year
, and read_acs5year
.
search_summarylevels(survey, years = NULL, keywords = NULL, view = TRUE)
search_summarylevels(survey, years = NULL, keywords = NULL, view = TRUE)
survey |
survey type, including "dec" (or "decennial"), "acs1" or "acs5". |
years |
year or ending year of the survey, can be a single year such as 2010 or a vector like 2014:2016. |
keywords |
keyword to search in code or description, in the form like "abc def dsdfsa". Rows with all words are returned. |
view |
display the search result with View if TRUE |
A data.table of searched results.
# Change view = TRUE (default) to View the returned data. aaa = search_summarylevels("decennial", 2010, "block", view = FALSE) bbb <- search_summarylevels("acs5", 2009:2010, "40", view = FALSE) ## Not run: # view all summary levels search_summarylevels("decennial") search_summarylevels("acs1") ## End(Not run)
# Change view = TRUE (default) to View the returned data. aaa = search_summarylevels("decennial", 2010, "block", view = FALSE) bbb <- search_summarylevels("acs5", 2009:2010, "40", view = FALSE) ## Not run: # view all summary levels search_summarylevels("decennial") search_summarylevels("acs1") ## End(Not run)
Search in lookup datasets of each survey to find references of
table_contents argument in function read_decennial
,
read_acs1year
, and read_acs5year
.
search_tablecontents(survey, years = NULL, keywords = NULL, view = TRUE)
search_tablecontents(survey, years = NULL, keywords = NULL, view = TRUE)
survey |
survey type, including "dec" (or "decennial"), "acs1" or "acs5". |
years |
year or ending year of the survey, can be a single year such as 2010 or a vector like 2014:2016. |
keywords |
keyword to search in code or description, in the form like "abc def dsdfsa". Rows with all words are returned. |
view |
display the search result with View if TRUE |
A data.table
# Change view = TRUE (default) to View the returned data. # search by what you want aaa <- search_tablecontents("dec", 2000, "federal prison", view = FALSE) ## Not run: # view all decennial census table contents search_tablecontents("dec") # view all ACS 5 year table contents search_tablecontents("acs5") ## End(Not run)
# Change view = TRUE (default) to View the returned data. # search by what you want aaa <- search_tablecontents("dec", 2000, "federal prison", view = FALSE) ## Not run: # view all decennial census table contents search_tablecontents("dec") # view all ACS 5 year table contents search_tablecontents("acs5") ## End(Not run)
Search table numbers and description.
search_tables(survey, years = NULL, keywords = NULL, view = TRUE)
search_tables(survey, years = NULL, keywords = NULL, view = TRUE)
survey |
survey type, including "dec" (or "decennial"), "acs1" or "acs5". |
years |
year or ending year of the survey, can be a single year such as 2010 or a vector like 2014:2016. |
keywords |
keyword to search in code or description, in the form like "abc def dsdfsa". Rows with all words are returned. |
view |
display the search result with View if TRUE |
A data.table
# Change view = TRUE (default) to View the returned data. aaa <- search_tables("dec", 2010, "occupancy", view = FALSE) bbb <- search_tables("acs5", 2014:2016, "detailed race", view = FALSE) ## Not run: # view all tables search_tables("dec") search_tables("acs1") ## End(Not run)
# Change view = TRUE (default) to View the returned data. aaa <- search_tables("dec", 2010, "occupancy", view = FALSE) bbb <- search_tables("acs5", 2014:2016, "detailed race", view = FALSE) ## Not run: # view all tables search_tables("dec") search_tables("acs1") ## End(Not run)
Set file path to directory storing downloaded census data
set_path_to_census(path)
set_path_to_census(path)
path |
path to directory holding all downloaded census data, such as "E:/my_census_data" and "~/my_census_data/". |
Abbrivation only
data("states_DC")
data("states_DC")
A vector of 51 element
There is slightly difference in the table contents of each year.
table_content_acs1year_all_years
table_content_acs1year_all_years
A data.table with 27246 rows and 7 variables
reference of the table content, such as "B01001_002". The reference is used to extract data of table content.
description of columns in a table
table names
restriction and availability of table content in 2019
restriction and availability of table content in 2018
restriction and availability of table content in 2017
restriction and availability of table content in 2016
restriction and availability of table content in 2015
restriction and availability of table content in 2014
restriction and availability of table content in 2013
restriction and availability of table content in 2012
restriction and availability of table content in 2011
restriction and availability of table content in 2010
restriction and availability of table content in 2009
restriction and availability of table content in 2008
restriction and availability of table content in 2007
restriction and availability of table content in 2006
restriction and availability of table content in 2005
the universe of the data
Check for each year of ACS 1-year and 5-year Sequence Number/Table Number Lookup File.