Skip to contents

Download and read lookup table of information on American Community Survey (ACS) tables, from the Census Bureau, namely which sequence files on the FTP site contain which tables and which variables. NOTE: This is largely obsolete now that data(lookup.acs2013) and similar files for other years are in this package.

Usage

download.lookup.acs(
  end.year = acsdefaultendyearhere_func(),
  folder = NULL,
  silent = FALSE
)

Arguments

end.year

Character, optional, like '2020', which specifies the 2016-2020 dataset. Defines which 5-year summary file to use, based on end-year. Can be acsfirstyearavailablehere or later. Data for end.year='2019' were released in December 2020, for example. The 2017-2021 American Community Survey 5-year estimates are scheduled to be released on Thursday, December 8, 2022.

folder

Optional path to where to download file to, defaults to temp folder.

silent

Optional, default is FALSE. Whether to send progress info to standard output (like the screen)

Value

By default, returns a data.frame with these fields:

  • $ Table.ID : chr "B00001" "B00001" "B00001" "B00002" ...

  • $ Sequence.Number : chr "0001" "0001" "0001" "0001" ...

  • $ Line.Number : num NA NA 1 NA NA 1 NA NA 1 2 ...

  • $ Start.Position : num 7 NA NA 8 NA NA 7 NA NA NA ...

  • $ Total.Cells.in.Table : chr "1 CELL" "" "" "1 CELL" ...

  • $ Total.Cells.in.Sequence: num NA NA NA 2 NA NA NA NA NA NA ...

  • $ Table.Title : chr "UNWEIGHTED SAMPLE COUNT OF THE POPULATION" "Universe: Total population" "Total" "UNWEIGHTED SAMPLE HOUSING UNITS" ...

  • $ Subject.Area : chr "Unweighted Count" "" "" "Unweighted Count" ...

For ACS 2008-2012:
length(my.lookup,1)
1 24741
names(my.lookup)
1 "File.ID" "Table.ID" "Sequence.Number" "Line.Number" "Start.Position"
6 "Total.Cells.in.Table" "Total.Cells.in.Sequence" "Table.Title" "Subject.Area"

See also

acs::acs.lookup() which does something similar but is more flexible & robust. Also see get.lookup.acs() which does the same without downloading file – uses the copy in data() Also see data(lookup.acs2013) and similar data for other years. Also see get.acs(), get.lookup.file.name(), get.url.prefix.lookup.table()

Examples

 if (FALSE) { # \dontrun{
 lookup.acs <- download.lookup.acs(2022)
 } # }