xyLayer | R Documentation |
Create a numeric vector from a function of the coordinates.
xyLayer(object, dirXY = y, vector = TRUE, maxpixels)
object |
A |
dirXY |
A expression indicating the function of |
vector |
Logical. If TRUE (default) a numeric vector is returned,
else a |
maxpixels |
A positive integer giving the number of cells to
display, for |
A numeric vector or a Raster
/SpatRaster
object.
Oscar Perpiñán Lamigueiro.
init
, substitute
, eval
library(raster)
f <- system.file("external/test.grd", package="raster")
r <- raster(f)
dirX <- xyLayer(r, x)
dirXY <- xyLayer(r, sqrt(x^2 + y^2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.