rasterReilly: Create a Raster from a Reilly Regular Grid

View source: R/reilly.R

rasterReillyR Documentation

Create a Raster from a Reilly Regular Grid

Description

This function creates a raster from a regularly spaced Reilly grid (output of the reilly function).

Usage

rasterReilly(x, mask = NULL)

Arguments

x

sp or sf object; output of the reilly function.

mask

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

Value

Raster of catchment areas values. The raster uses a RAT (ratify) that contains the correspondance between raster values and catchement areas values. Use unique(levels(rasterName)[[1]]) to see the correpondance table.

See Also

reilly, plotReilly.

Examples

library(raster)
data(hospital)
# Compute Reilly catchment areas from known points (hospital) on a
# grid defined by its resolution
myreilly <- reilly(knownpts = hospital, varname = "capacity",
                   typefct = "exponential", span = 1250, beta = 3,
                   resolution = 200, mask = paris, returnclass = "sf")
# Create a raster of reilly values
myreillyraster <- rasterReilly(x = myreilly, mask = paris)
plot(myreillyraster, col = rainbow(18))
# Correspondance between raster values and reilly areas
head(unique(levels(myreillyraster)[[1]]))

SpatialPosition documentation built on Sept. 14, 2023, 5:07 p.m.