en_passage {enerscape}R Documentation

Compute probability of passage of random walks

Description

Calculate the net number of passages of random walks between origin and destination.

Usage

en_passage(
  en,
  or,
  dest,
  theta = 4,
  simulate_random_points = FALSE,
  rep = 10,
  plot = TRUE
)

Arguments

en

an enerscape object obtained with enerscape().

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 simulate_random_points = TRUE. default = 10.

plot

if to plot the output.

Details

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.

Value

A list with point locations, rasterLayer of net passage of random walks, and rasterLayer of cumulative net passage if simulate_random_points = TRUE.

Examples

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)

[Package enerscape version 0.1.3 Index]