direction | R Documentation |
The direction (azimuth) to or from the nearest cell that is not NA
. The direction is expressed in radians, unless you use argument degrees=TRUE
.
## S4 method for signature 'SpatRaster'
direction(x, from=FALSE, degrees=FALSE, filename="", ...)
x |
SpatRaster |
filename |
Character. Output filename (optional) |
degrees |
Logical. If |
from |
Logical. Default is |
... |
Additional arguments as for |
SpatRaster
distance
r <- rast(ncol=36,nrow=18, crs="+proj=merc")
values(r) <- NA
r[306] <- 1
b <- direction(r, degrees=TRUE)
plot(b)
crs(r) <- "+proj=longlat"
b <- direction(r)
plot(b)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.