Package {actiwalkability}


Type: Package
Title: Access the EPA Walkability Index
Version: 0.2.0
Description: Provides helpers for querying the EPA Walkability Index https://www.epa.gov/smartgrowth/national-walkability-index-user-guide-and-methodology and working with Census GEOID/FIPS identifiers https://www.census.gov/programs-surveys/geography/guidance/geo-identifiers.html.
License: GPL-3
Depends: R (≥ 4.1.0)
Suggests: covr, ggplot2, ggrepel, knitr, withr, testthat (≥ 3.0.0), rmarkdown, sf
Encoding: UTF-8
VignetteBuilder: knitr
Imports: assertthat, curl, dplyr, jsonlite, rlang, stats, utils
Config/roxygen2/version: 8.1.1
URL: https://github.com/jhuwit/actiwalkability, https://jhuwit.github.io/actiwalkability/
BugReports: https://github.com/jhuwit/actiwalkability/issues
Config/testthat/edition: 3
NeedsCompilation: no
Packaged: 2026-11-24 21:07:03 UTC; johnmuschelli
Author: John Muschelli ORCID iD [aut, cre]
Maintainer: John Muschelli <muschellij2@gmail.com>
Repository: CRAN
Date/Publication: 2026-11-24 21:30:02 UTC

Get EPA Walkability Index

Description

Queries the EPA National Walkability Index ArcGIS layer directly through its REST API. Results are requested in chunks of the service's maxRecordCount, so large selections are returned in full.

Usage

acti_epa_walkability(
  geoid,
  geometry = FALSE,
  fields = NULL,
  filter_geom = NULL,
  predicate = "intersects",
  n_max = Inf,
  ...
)

Arguments

geoid

GEOID10 of the area of interest. This should be a 12 character string. If NULL, then all GEOIDs are selected (subject to filter_geom). This can be a lot of data, so use with caution.

geometry

Should block-group polygons be returned? If TRUE, the result is an sf object in Web Mercator (EPSG:3857), which requires the sf package. If FALSE (default), a tibble of attributes.

fields

Character vector of fields to return. NULL (default) returns all fields. See acti_epa_walkability_metadata()$fields.

filter_geom

Optional spatial filter: an sf, sfc, sfg, or bbox object (requires sf). Multiple features are unioned. Inputs with a CRS are transformed to WGS 84 (EPSG:4326). An sfg has no CRS, so it is assumed to already be in longitude/latitude (EPSG:4326); passing projected coordinates as an sfg gives a wrong spatial filter.

predicate

Spatial relationship between the layer and filter_geom: one of "intersects", "contains", "crosses", "envelope_intersects", "index_intersects", "overlaps", "touches", or "within".

n_max

Maximum number of records to return.

...

Additional named ArcGIS query parameters passed to the layer's query endpoint (see the ArcGIS REST API "Query (Map Service/Layer)" documentation).

Value

A tibble (or an sf object if geometry = TRUE) with a cat_walk_index factor added when NatWalkInd is returned.

Note

See https://geodata.epa.gov/arcgis/rest/services/OA/WalkabilityIndex/MapServer/0

Examples


# Only run if the EPA ArcGIS service responds
epa_up <- tryCatch(
  curl::curl_fetch_memory(
    "https://geodata.epa.gov/arcgis/rest/services/OA/WalkabilityIndex/MapServer/0?f=json",
    handle = curl::new_handle(timeout = 10)
  )$status_code == 200,
  error = function(e) FALSE
)
if (epa_up) {
  acti_epa_walkability(c("240054519002", "240054026041", "245102303002"))
}


Get EPA Walkability Index layer metadata

Description

Requests the EPA Walkability Index ArcGIS layer description and returns its metadata. This includes the available fields, layer extent, geometry type, and service limits such as maxRecordCount.

Usage

acti_epa_walkability_metadata()

Value

A list containing the ArcGIS layer metadata, with fields as a data.frame and the layer url added.

Note

See https://geodata.epa.gov/arcgis/rest/services/OA/WalkabilityIndex/MapServer/0

Examples

## Not run: 
metadata <- acti_epa_walkability_metadata()
metadata$fields

## End(Not run)

Get Census Tract FIPS codes

Description

Get Census Tract FIPS codes

Usage

acti_fips15(state, county, tract, block = NA)

acti_fips12(state, county, tract, block = NA)

Arguments

state

2-digit state FIPS code.

county

3-digit county FIPS code.

tract

6-digit tract FIPS code.

block

4-digit block FIPS code. If omitted or NA, tract-level codes are returned.

Value

An 11-to-15 digit GEOID/FIPS code.

Examples

suppressWarnings(acti_fips15(24, 510, 60400))
acti_fips15(24, 510, 60400, block = 2002)
acti_fips12(24, 510, 60400, block = 2002)