direction | R Documentation |
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
distance
, gridDistance
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.