View source: R/edge_covariates.R
| edge_gradient | R Documentation |
Builds the antisymmetric per-directed-edge covariate
d_{ab} = x_a - x_b used by terradish_directed to drive
directional gene flow (e.g. elevation drop, flow accumulation, wind
potential). d_{ab} = -d_{ba}, so a positive coefficient makes movement
from high to low x faster.
edge_gradient(x, data)
x |
A |
data |
A |
A list with edges (an integer matrix of directed edges, columns
a, b, 1-based node indices) and d (the matching numeric
vector d_{ab} = x_a - x_b).
terradish_directed
coords <- as.matrix(expand.grid(x = 0:2, y = 0:2))
g <- deme_graph(coords, neighbours = "lattice")
elevation <- c(10, 20, 30, 25, 15, 5, 8, 18, 28)
edge_gradient(elevation, g)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.