Learn R Programming

SpatialPosition (version 1.0)

rasterReilly: Create a Raster from a Reilly SpatialPointsDataFrame

Description

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

Usage

rasterReilly(x, mask = NULL)

Arguments

x
sp object (SpatialPointsDataFrame); output of the reilly function.
mask
sp object (SpatialPolygonsDataFrame); 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, rasterReilly, plotReilly, CreateGrid, CreateDistMatrix.

Examples

Run this code
data(spatData)
row.names(spatPts) <- spatPts$CodHop
# Compute Reilly catchment areas from known points (spatPts) on a
# grid defined by its resolution
myreilly <- reilly(knownpts = spatPts, varname = "Capacite",
                   typefct = "exponential", span = 750, beta = 2,
                   resolution = 50, longlat = FALSE, mask = spatMask)
# Create a raster of reilly values
myreillyraster <- rasterReilly(x = myreilly, mask = spatMask)
plot(myreillyraster, col = rainbow(18))
# Correspondance between raster values and reilly areas
head(unique(levels(myreillyraster)[[1]]))

Run the code above in your browser using DataLab