en_passage {enerscape} | R Documentation |
Calculate the net number of passages of random walks between origin and destination.
en_passage(
en,
or,
dest,
theta = 4,
simulate_random_points = FALSE,
rep = 10,
plot = TRUE
)
en |
an enerscape object obtained with |
or |
origin point. |
dest |
destination point. |
theta |
the degree from which the path randomly deviates from the least-cost path. |
simulate_random_points |
if to simulate least-cost path among random points. default = FALSE. |
rep |
number or random origin and destination points if
|
plot |
if to plot the output. |
If or
and dest
are not specified, the least-cost path
is specified by setting simulate_random_points = TRUE
and rep
equal to the number of random paths to compute.
A list with point locations, rasterLayer of net passage of random
walks, and rasterLayer of cumulative net passage if
simulate_random_points = TRUE
.
library(raster)
data("volcano")
dem <- raster(volcano)
en <- enerscape(dem, 10, unit = "kcal", neigh = 16)
p <- xyFromCell(dem, sample(ncell(dem), 2))
walk <- en_passage(en, or = p[1, ], dest = p[2, ], theta = 4)