zshift | R Documentation |
Calculates a matrix of values with a negative or positive, x or y, offset.
zshift(r, xdist = 0, ydist = 0, xrm, yrm, scale = FALSE)
r |
A raster or matrix. |
xdist |
Numeric indicating the number and direction (+, -) of columns for the offset. |
ydist |
Numeric indicating the number and direction (+, -) of rows for the offset. |
xrm |
Numeric value or vector indicating the number of
columns to be removed from the final matrix. If not set,
this value defaults to |
yrm |
Numeric value or vector indicating the number
of rows to be removed from the final matrix. If not set,
this value defaults to |
scale |
Logical. Indicates whether or not to scale the values of the raster. |
A numeric vector of values created from a matrix of the values
with the specified offset. The vector is created from a matrix with
xrm
fewer columns and yrm
fewer rows than the original
raster value matrix.
# import raster image
data(normforest)
normforest <- terra::unwrap(normforest)
# remove right and bottom borders 2 deep
noborder <- zshift(normforest, xdist = 2, ydist = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.