direction

0th

Percentile

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.

Keywords
spatial
Usage
# S4 method for 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. If TRUE, the direction from (instead of to) the nearest cell that is not NA is returned

doEdge

Logical. If TRUE, the boundaries function is called first. This may be efficient in cases where you compute the distance to large blobs. Calling boundaries determines the edge cells that matter for distance computation

...

Additional arguments as for writeRaster

Value

RasterLayer

See Also

distance, gridDistance

For the direction between (longitude/latitude) points, see the azimuth function in the geosphere package

Aliases
  • direction
  • direction,RasterLayer-method
Examples
# NOT RUN {
r <- raster(ncol=36,nrow=18)
r[] <- NA
r[306] <- 1
b <- direction(r) 
#plot(b)
# }
Documentation reproduced from package raster, version 2.9-5, License: GPL (>= 3)

Community examples

Looks like there are no examples yet.