View source: R/nodes_by_edges_matrix.R
| nodes_by_edges_matrix | R Documentation |
Creates a nodes-by-edges matrix that will be used by aem() of the package
adespatial. This function creates the same output as aem.build.binary()
of the package adespatial but works in a different way: it's only based on
node labels (not on coordinates). Also, this function adds labels to nodes
and edges.
nodes_by_edges_matrix(edges)
edges |
a |
A list of two elements:
se.mat: the nodes-by-edges matrix of dimensions n x k, where n is
the number of nodes and k the number of edges (including the edge
between the fictitious origin and the first site);
edges: a data.frame of edge list.
library("chessboard")
# Two-dimensional sampling ----
sites_infos <- expand.grid("transect" = 1:3, "quadrat" = 1:5)
sites_infos
nodes <- create_node_labels(data = sites_infos,
transect = "transect",
quadrat = "quadrat")
edges <- create_edge_list(nodes, method = "pawn", directed = TRUE)
# Create nodes-by-edges matrix ----
nodes_by_edges_matrix(edges)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.