powered by
Create a RasterLayer from a function of the coordinates.
xyLayer(object, dirXY = y)
A Raster object.
Raster
A expression indicating the function of x and y (coordinates of the Raster object) to be evaluated.
x
y
A RasterLayer object.
init, substitute, eval
init
substitute
eval
# 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