nodes_by_edges_matrix {chessboard}R Documentation

Create a nodes-by-edges matrix

Description

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.

Usage

nodes_by_edges_matrix(edges)

Arguments

edges

a data.frame with the following two columns: from (the first node of the edge) and to (the second node of the edge).

Value

A list of two elements:

Examples

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)

[Package chessboard version 0.1 Index]