Learn R Programming

SpatialPosition (version 1.2.0)

rasterHuff: Create a Raster from a Huff SpatialPointsDataFrame

Description

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

Usage

rasterHuff(x, mask = NULL)

Arguments

x

sp object (SpatialPointsDataFrame); output of the huff function.

mask

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

Value

Raster of catchment areas values.

See Also

huff, rasterHuff, plotHuff, CreateGrid, CreateDistMatrix.

Examples

Run this code
# NOT RUN {
data(spatData)
# Compute Huff catchment areas from known points (spatPts) on a
# grid defined by its resolution
myhuff <- huff(knownpts = spatPts, varname = "Capacite",
               typefct = "exponential", span = 750, beta = 2,
               resolution = 100, mask = spatMask)
# Create a raster of huff values
myhuffraster <- rasterHuff(x = myhuff, mask = spatMask)
plot(myhuffraster)
# }

Run the code above in your browser using DataLab