Direction
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
.
## S4 method for signature 'RasterLayer' direction(x, filename='', degrees=FALSE, from=FALSE, doEdge=FALSE, ...)
x |
RasterLayer object |
filename |
Character. Output filename (optional) |
degrees |
Logical. If |
from |
Logical. Default is |
doEdge |
Logical. If |
... |
Additional arguments as for |
RasterLayer
For the direction between (longitude/latitude) points, see the azimuth
function in the geosphere
package
r <- raster(ncol=36,nrow=18) values(r) <- NA r[306] <- 1 b <- direction(r) #plot(b)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.