Skip to contents

Create separate data.tables, and optionally save them in the EJAM package This is just done when Census FIPS or bounds or points change.

Usage

census2020_save_datasets(
  x,
  metadata = NULL,
  add_metadata = TRUE,
  save_as_data_for_package = FALSE,
  overwrite = TRUE,
  keep_pop = FALSE
)

Arguments

x

a single data.table called blocks that is from census2020_get_data(), with colnames blockfips, pop, area, lat, lon

metadata

default is Census 2020 related, tries to use EJAM package

add_metadata

logical, whether to add EJAM-related metadata about date and version

save_as_data_for_package

logical, whether to do usethis::use_data() here

overwrite

default is TRUE, but only relevant if usethis = TRUE

keep_pop

set to TRUE to keep the blockpop (population counts) column, but it is not used by EJAM except here to create the weights before it is dropped by default.

Value

A named list of these huge data.tables for the EJAM package:

  • bgid2fips

  • blockid2fipshttps://ejanalysis.github.io/EJAM/reference/blockid2fips.html

  • blockpointshttps://ejanalysis.github.io/EJAM/reference/blockpoints.html

  • blockwtshttps://ejanalysis.github.io/EJAM/reference/blockwts.html

  • quaddatahttps://ejanalysis.github.io/EJAM/reference/quaddata.html

See also

census2020_save_datasets() creates individual data.tables, after census2020_get_data() has done these: