cost.acc_cost
The accumulated cost from the nearest origin over a transition of conductances (gdistance's accCost through landschaft's C++): inf where no origin can be reached.
| Input | Type | What it is |
transitionrequired | stack | a transition (cost.transition) |
originsrequired | any | points (vector features) or a mask (its cells not 0) |
| Output | Type | What it is |
map | map | the accumulated cost |
cost.areas
Area transitions of a map of categories (gdistance's transition(x, "areas")): one per category k (1, 2, ... n: the value k), 1 between two cells of it, 0.5 between one of it and another cell, as weights of cost.path_inc.
| Input | Type | What it is |
maprequired | map | categories 1..n |
| Output | Type | What it is |
transitions | stack | a set of transitions |
| Setting | Type | What it is |
directions | integer | 4, 8 (default) or 16 |
cost.barriers
Barrier transitions of a map (gdistance's transition(x, "barriers")): each marks with 1 (as resistances) the connections that cross a boundary, as weights of cost.path_inc. With breaks: one per break, between a cell below it and one above; else the values are categories: one per pair of categories in gdistance's order ((2, 1), (3, 1), ..., (3, 2), ...), two (one per way) when not symmetric.
| Input | Type | What it is |
maprequired | map | the values |
| Output | Type | What it is |
transitions | stack | a set of transitions |
| Setting | Type | What it is |
directions | integer | 4, 8 (default) or 16 |
breaks | any | breaks of continuous values: [b1, b2, ...] |
symmetric | bool | categories: both ways in one (default true) |
cost.combine
Two transitions on the same grid added, subtracted or multiplied connection by connection (gdistance's Arith on TransitionLayers), in their common layout: the most directions, symmetric when both are.
| Input | Type | What it is |
arequired | stack | a transition |
brequired | stack | another, on the same grid |
| Output | Type | What it is |
transition | stack | the result |
| Setting | Type | What it is |
operation | text | sum (default), difference or product |
cost.commute_distance
The expected commute distances of a random walk between points (gdistance's commuteDistance through landschaft's C++): how long a walk that moves to a neighbour with a probability proportional to the conductance takes, on average, to reach the other point and come back; the effective resistance times the graph's volume. inf between separate parts of the graph, no value for points outside it.
| Input | Type | What it is |
transitionrequired | stack | a transition (cost.transition) |
pointsrequired | vector | the points |
| Output | Type | What it is |
table | table | a row per point: its number, then the distance to each point |
cost.distance
The least costs between points over a transition of conductances (gdistance's costDistance through landschaft's C++): from every point to every other (a symmetric matrix when the transition is), or to every point of another set; no value for points outside the grid.
| Input | Type | What it is |
transitionrequired | stack | a transition (cost.transition) |
fromrequired | vector | the points |
to | vector | other points (default: the same) |
| Output | Type | What it is |
table | table | a row per point from: its number, then the cost to each point |
cost.geo_correction
A transition corrected for the distances between cells' centres (gdistance's geoCorrection through landschaft's C++): divided by them (type c, least-cost distances), or also by the cells' widths across the connection (type r, random walks); great-circle distances on longitude/latitude grids.
| Input | Type | What it is |
transitionrequired | stack | a transition (cost.transition) |
| Output | Type | What it is |
transition | stack | the corrected transition |
| Setting | Type | What it is |
type | text | c (default) or r |
scale | bool | scaled by the distance between the grid's first cells |
cost.mahal
The Mahalanobis transition of a stack of maps (gdistance's transition(brick, "mahal")): for every pair of neighbouring cells with values in all maps, the Mahalanobis distance d between their values (with the inverse of the maps' covariance); the connection is mean(d) / (d + mean(d)). R's cov, solve, %*% and mean, to the bit.
| Input | Type | What it is |
mapsrequired | stack | two or more maps |
| Output | Type | What it is |
transition | stack | a symmetric transition |
| Setting | Type | What it is |
directions | integer | 4, 8 (default) or 16 |
cost.math
A function of a transition's values on its connections (landschaft's Transition.map, R's maths to the bit): sqrt, exp, log, pow (to a value), multiply (by a value) or divide (a value by each, the reciprocal for 1); NaN results leave the connection out.
| Input | Type | What it is |
transitionrequired | stack | a transition (cost.transition) |
| Output | Type | What it is |
transition | stack | the result |
| Setting | Type | What it is |
functionrequired | text | sqrt, exp, log, pow, multiply or divide |
value | number | the power, the factor or the dividend (default 1) |
cost.normalize
A transition normalised (gdistance's normalize): each row divided by its sum (the probabilities of a random walk; asymmetric), each column, or by the square roots of the row and column sums (stays symmetric).
| Input | Type | What it is |
transitionrequired | stack | a transition (cost.transition) |
| Output | Type | What it is |
transition | stack | the normalised transition |
| Setting | Type | What it is |
method | text | row (default), col or symm |
cost.passage
The passages of a random walk from origins to goals through every cell (gdistance's passage through landschaft's C++). Without theta: the net number of times a random walk passes through each cell, the current of a unit current from the origins to the goals (a symmetric transition; 1 at the origins and goals, 0 off the graph). With theta (0 to 20): randomised shortest paths (Saerens et al. 2009), that prefer cheap routes more as theta grows; no value off the graph.
| Input | Type | What it is |
transitionrequired | stack | a transition (cost.transition) |
originsrequired | any | points (vector features) or a mask (its cells not 0) |
goalsrequired | any | points (vector features) or a mask (its cells not 0) |
| Output | Type | What it is |
map | map | the passages |
| Setting | Type | What it is |
theta | number | randomised shortest paths, 0 to 20 (default: none) |
total_net | text | with theta: net (default) or total passages |
gdistance_compat | bool | without theta: gdistance's potential of the grounded cell (default true); false: the exact currents |
cost.path_inc
The overlap and non-overlap of the routes from a common origin to each location (gdistance's pathInc through landschaft's C++, van Etten & Hijmans 2010): the flow of a random walk (or, with theta, of randomised shortest paths) from the origin to each location on every connection, then for each pair of locations the sum over the connections of min(f1, f2) (overlap) or max(f1, f2)(1 - min) - min (non-overlap), weighted by the cost of each connection or by weights (a transition, or a set: cost.barriers, cost.areas; a result per transition).
| Input | Type | What it is |
transitionrequired | stack | a transition (cost.transition) |
originrequired | vector | the common origin (one point) |
fromrequired | vector | the locations |
to | vector | other locations (default: the pairs among from) |
weights | stack | a transition or a set (default: the costs) |
| Output | Type | What it is |
overlap | table | a row per weight and location: its numbers, then each pair's |
nonoverlap | table | the same, of the non-overlap |
| Setting | Type | What it is |
theta | number | randomised shortest paths, 0 to 20 (default: random walks) |
gdistance_compat | bool | random walks: gdistance's grounded cell (default true) |
cost.rsp_distance
Randomised-shortest-path distances between points (gdistance's rSPDistance through landschaft's C++): the expected cost of the walk from each point to each other, near a random walk's with theta near 0, near the least cost with large theta. No value for points off the grid.
| Input | Type | What it is |
transitionrequired | stack | a transition (cost.transition) |
fromrequired | vector | the points |
to | vector | other points (default: the same) |
| Output | Type | What it is |
table | table | a row per point from: its number, then the cost to each point |
| Setting | Type | What it is |
thetarequired | number | 0 to 20 |
total_net | text | the cost of the net (default) or total passages |
method | integer | 1 (default): exp(-theta cost) P; 2: P^theta |
cost.shortest_path
The least-cost paths from an origin to goals over a transition of conductances (gdistance's shortestPath through landschaft's C++, igraph's ties): lines through the cells' centres, and a map of the share of the paths that cross each cell.
| Input | Type | What it is |
transitionrequired | stack | a transition (cost.transition) |
originrequired | vector | the origin (the first point) |
goalsrequired | vector | the goals |
| Output | Type | What it is |
lines | vector | a line per goal (id 1..) |
map | map | the share of the paths through each cell |
cost.sum_reciprocal
Two transitions of conductances as resistances in series (gdistance's sumReciprocal): 1 / (1/a + 1/b) on the connections.
| Input | Type | What it is |
arequired | stack | a transition |
brequired | stack | another, on the same grid |
| Output | Type | What it is |
transition | stack | the result |
cost.to_map
A map of each cell's connections (gdistance's raster() of a TransitionLayer): sums or means of the matrix's columns (connections into the cell) or rows (out of it); NZ: the mean over the connections only (no value without any).
| Input | Type | What it is |
transitionrequired | stack | a transition (cost.transition) |
| Output | Type | What it is |
map | map | a value per cell |
| Setting | Type | What it is |
reduce | text | NZcolMeans (default)... |
cost.transition
A transition between neighbouring cells (gdistance's transition through landschaft's C++): the connection of every cell with its 4, 8 or 16 neighbours, a function of the two cells' values (mean, min, max, sum, prod, from, to, diff, harmonic, geometric), none where either has no value. Usually of a conductance (1 / resistance), then corrected for the cells' distances (cost.geo_correction).
| Input | Type | What it is |
maprequired | map | the values (a conductance, usually) |
| Output | Type | What it is |
transition | stack | a layer per direction |
| Setting | Type | What it is |
function | text | of the two cells' values: mean (default)... |
directions | integer | 4, 8 (default) or 16 |
symmetric | bool | one value per pair of cells (default true) |
reciprocal | bool | 1 / the function's value (a conductance of a resistance; gdistance's 1 / transition(r, mean)) |