Direction
direction.RdThe 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 class 'RasterLayer'
direction(x, filename='', degrees=FALSE, from=FALSE, doEdge=FALSE, ...)Arguments
- x
RasterLayer object
- filename
Character. Output filename (optional)
- degrees
Logical. If
FALSE(the default) the unit of direction is radians.- from
Logical. Default is
FALSE. IfTRUE, the direction from (instead of to) the nearest cell that is notNAis returned- doEdge
Logical. If
TRUE, theboundariesfunction is called first. This may be efficient in cases where you compute the distance to large blobs. Callingboundariesdetermines the edge cells that matter for direction computation- ...
Additional arguments as for
writeRaster