to_matrix: Matrix conversion for Population Graph
Description
This function translates a Population to a matrix
representing either the adjacency structure, the shortest
path, or edge weights.Usage
to_matrix(x,
mode = c("adjacency", "shortest path", "edge weight")[1],
...)Arguments
x
An object of type popgraph
mode
The kind of matrix to make. At present, the
following types are available: {A binary matrix representing the pairs
of connected nodes (default)} - shortest path
{The
shortest path between all nodes.} - edge
Value
- A matrix (KxK) in size (where K is the number of nodes)