drivablecountiesvsregion: Compare an Existing Region to a List of Drivable Counties

View source: R/drivablecountiesvsregion.R

drivablecountiesvsregionR Documentation

Compare an Existing Region to a List of Drivable Counties

Description

Compare an exiting georegion to a list of drivable counites or generate the drivable list based on a driving time radius.

Usage

drivablecountiesvsregion(
  regiondf,
  drivingdistance,
  countymaps = NA,
  fipscodes = NA,
  output = c("nearbydf", "mapdata", "outsidecountiesdf", "map")
)

Arguments

regiondf

an existing data frame or a file URL

drivingdistance

an object of class drivingdistance or a numeric distance from the center of regiondf

countymaps

a spatialpolygonsdataframe. If NA, data is downloaded and read from the US Census

fipscodes

a data frame of fips codes for all counties with bannerized codes added. If NA, data from the tigris package is modified to work

output

a character vector describing what output you want. Available options include, "nearbydf", "mapdata", "outsidecountiesdf" and "map"

Value

if more than one output is selected, a list containing values of each. If only one output is selected, the object itself is return, without being wrapped in a list. Outputs include:

  • "nearbydf" a data frame of nearby counties and their distance to the center of the region

  • "mapdata" a SpaitalPolygonsDataFrame of the nearby counties appropriate for use in a leaflet map

  • "outsidecountiesdf" a data frame of counties that are within driving range but outside the regiondf

  • "map" a pre-generated leaflet map


crazybilly/rmapcounties documentation built on Jan. 4, 2024, 6:32 a.m.