pad_edges | R Documentation |
Extends edge values of a raster or matrix by a specified number of pixels.
pad_edges(x, size, val = NULL)
x |
A matrix. |
size |
Numeric. Number of pixels to add to each side. |
val |
Numeric. If NULL (default), this extends the edge values out. If not null, this value will be used for the extended cells. |
A raster with edges padded size
number of pixels on each edge.
# import raster image
data(normforest)
normforest <- terra::unwrap(normforest)
# crop raster to much smaller area
x <- pad_edges(as.matrix(normforest), 3, val = NA)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.