rasterHuff: Create a Raster from a Huff SpatialPointsDataFrame

View source: R/huff.R

rasterHuffR Documentation

Create a Raster from a Huff SpatialPointsDataFrame

Description

This function creates a raster from a regularly spaced Huff grid (output of the huff function).

Usage

rasterHuff(x, mask = NULL)

Arguments

x

sp or sf object; output of the huff function.

mask

sp or sf object; this object is used to clip the raster. (optional)

Value

Raster of catchment areas values.

See Also

huff, plotHuff.

Examples

library(raster)
data(hospital)
# Compute Huff catchment areas from known points (hospital) on a
# grid defined by its resolution
myhuff <- huff(knownpts = hospital, varname = "capacity",
               typefct = "exponential", span = 750, beta = 2,
               resolution = 100, mask = paris, returnclass = "sf")
# Create a raster of huff values
myhuffraster <- rasterHuff(x = myhuff, mask = paris)
plot(myhuffraster)

Groupe-ElementR/SpatialPosition documentation built on Sept. 14, 2023, 6:14 a.m.