compute_accessibility: Compute zonal statistics for travel time from the area of...

View source: R/compute_accessibility.R

compute_accessibilityR Documentation

Compute zonal statistics for travel time from the area of interest to the nearby cities

Description

Returns the result in long-table format

Usage

compute_accessibility(aoi = NULL, acc_rast = NULL, idcol = NULL, opn = "mean")

Arguments

aoi

area of interest - polygon (sf)

acc_rast

accessibility raster (terra)

idcol

A character vector identifying a column name which uniquely identifies the polygons in the aoi object.

opn

A type of zonal operation (sum/mean/min/max) - mean being default value

Value

zonal statistics

Examples



# load raster
r <- terra::rast(system.file("extdata", "test_acc_rast.tif", package = "openRspat"))
# load polygon
fname <- system.file("shape/nc.shp", package="sf")
sf <- sf::st_read(fname)
# provide unique id column
idcol <- sf[1, ]$CNTY_ID
# zonal operation type
opn <- "min"
# call function
compute_accessibility(aoi=sf[1,], acc_rast=r, idcol=idcol, opn=opn)



Ohm-Np/openRspat documentation built on June 23, 2022, 3:03 p.m.