direction {raster} | R Documentation |
Direction
Description
The direction (azimuth) to or from the nearest cell that is not NA
. The direction unit is in radians, unless you use argument degrees=TRUE
.
Usage
## S4 method for signature 'RasterLayer'
direction(x, filename='', degrees=FALSE, from=FALSE, doEdge=FALSE, ...)
Arguments
x |
RasterLayer object |
filename |
Character. Output filename (optional) |
degrees |
Logical. If |
from |
Logical. Default is |
doEdge |
Logical. If |
... |
Additional arguments as for |
Value
RasterLayer
See Also
For the direction between (longitude/latitude) points, see the azimuth
function in the geosphere
package
Examples
r <- raster(ncol=36,nrow=18)
values(r) <- NA
r[306] <- 1
b <- direction(r)
#plot(b)