load_tiger function

Helper function to download Census data

Helper function to download Census data

load_tiger( url, refresh = getOption("tigris_refresh", FALSE), tigris_type = NULL, class = getOption("tigris_class", "sf"), progress_bar = TRUE, keep_zipped_shapefile = FALSE, filter_by = NULL )

Arguments

  • url: URL for zipped shapefile in TIGER database (constructed in calling function).
  • refresh: Whether to re-download shapefiles if cached. Defaults to value of the global option "tigris_refresh" if that option is, and FALSE if not. This will override the behavior set in "tigris_refresh" option if a value (TRUE or FALSE) is provided.
  • tigris_type: Added as an attribute to return object (used internally).
  • class: Class of return object. Must be one of "sf" (the default) or "sp".
  • progress_bar: If set to FALSE, do not display download progress bar (helpful for R Markdown documents). Defaults to TRUE.
  • keep_zipped_shapefile: If set to TRUE, do not delete zipped shapefile (stored in temporary directory or TIGRIS_CACHE_DIR depending on the configuration of global option "tigris_use_cache"). Defaults to FALSE.
  • filter_by: Geometry used to filter the output returned by the function. Can be an sf object, an object of class bbox, or a length-4 vector of format c(xmin, ymin, xmax, ymax) that can be converted to a bbox. Geometries that intersect the input to filter_by will be returned.

Returns

sf or sp data frame

  • Maintainer: Kyle Walker
  • License: MIT + file LICENSE
  • Last published: 2024-01-24