NA
. The direction unit is in radians, unless you use argument degrees=TRUE
.## S3 method for class 'RasterLayer':
direction(x, filename='', degrees=FALSE, from=FALSE, doEdge=FALSE, ...)
FALSE
(the default) the unit of direction is radians.FALSE
. If TRUE
, the direction from (instead of to) the nearest cell that is not NA
is returnedTRUE
, the edge
function is called first. This may be efficient in cases where you compute the distance to large blobs. Calling edge determines the edge cells that matter for distance cwriteRaster
distance
, gridDistance
For the direction between (longitude/latitude) points, see the azimuth
function in the geosphere
packager <- raster(ncol=36,nrow=18)
r[] <- NA
r[306] <- 1
b <- direction(r)
#plot(b)
Run the code above in your browser using DataLab