| deme_graph | R Documentation |
Builds the minimal spatial graph that landscape-genetic network methods use: a
set of vertex coordinates and an undirected edge list. For deme-scale problems
(dozens to a few hundred nodes) this avoids the heavier raster / conductance
graph builders, and the returned object is interchangeable with a
terradish_graph.
deme_graph(
coords,
neighbours = c("delaunay", "knn", "lattice"),
k = 6L,
queen = FALSE
)
coords |
A two-column numeric matrix or data frame of node (deme) coordinates, one row per node (columns x, y). |
neighbours |
Edge construction. |
k |
Number of neighbours for |
queen |
For |
An object of class c("landgraph", "terradish_graph") with
vertex_coordinates (an n x 2 matrix), edge_pairs (an
m x 2 integer matrix of 1-based undirected edges, each pair once,
a < b), and n_vertices.
edge_gradient, edge_flow
coords <- as.matrix(expand.grid(x = 0:4, y = 0:4))
g <- deme_graph(coords, neighbours = "lattice")
nrow(g$edge_pairs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.