powered by
Create a numeric vector from a function of the coordinates.
xyLayer(object, dirXY = y, vector = TRUE, maxpixels)
A numeric vector or a Raster/SpatRaster object.
Raster
SpatRaster
A Raster or a SpatRaster object.
A expression indicating the function of x and y (coordinates of the Raster object) to be evaluated.
x
y
Logical. If TRUE (default) a numeric vector is returned, else a Raster or a SpatRaster object is returned.
A positive integer giving the number of cells to display, for sampleRegular or spatSample.
sampleRegular
spatSample
Oscar Perpiñán Lamigueiro.
init, substitute, eval
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))
Run the code above in your browser using DataLab