Skip to contents

Get info on tables from US Census Bureau for American Community Survey 5-year summary file.

Usage

get.field.info(
  tables,
  end.year = acsdefaultendyearhere_func(),
  table.info.only = FALSE,
  moe = FALSE,
  basic = FALSE,
  silent = FALSE
)

Arguments

tables

Required vector of tables such as "B01001"

end.year

Last year of 5-year summary file such as '2018'

table.info.only

FALSE by default. If TRUE, only return info about the table(s), not variables in table(s).

moe

FALSE by default. Margin of error variables also included if TRUE, but their names are identical to those of estimates fields other than being MOE instead of estimate.

basic

FALSE by default. If TRUE, a very limited subset of the info is returned (just variable number and name). This parameter is ignored if table.info.only=TRUE

silent

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

Value

data.frame of information about each table and each variable in table:
Value returned is data.frame of info about each table and also each variable in the table
e.g., longname2 which is version where no spaces or colons or escaped quotation marks etc.

Details

Uses get.lookup.acs() but for latest version could just use data(lookup.acs)

Examples

if (FALSE) { # \dontrun{
  finfo <- get.field.info(c('B17020A', 'B17020H'))
  cbind(
    names(tracts), substr(finfo$longname.unique[match(names(tracts), finfo$shortname)], 1, 100)
  )
  foundnames <- names(tracts)[names(tracts) %in% finfo$shortname]
  cbind(
    foundnames, substr(finfo$longname.unique[match(foundnames, finfo$shortname)], 1, 100)
  )
} # }