rasterVis (version 0.47)

xyLayer: xyLayer

Description

Create a RasterLayer from a function of the coordinates.

Usage

xyLayer(object, dirXY = y)

Arguments

object

A Raster object.

dirXY

A expression indicating the function of x and y (coordinates of the Raster object) to be evaluated.

Value

A RasterLayer object.

See Also

init, substitute, eval

Examples

Run this code
# NOT RUN {
f <- system.file("external/test.grd", package="raster")
r <- raster(f)
dirX <- xyLayer(r, x)
dirXY <-xyLayer(r, sqrt(x^2 + y^2))
levelplot(dirXY, margin=FALSE)
# }

Run the code above in your browser using DataLab