Learn R Programming

MetaLandSim (version 0.2)

matrix.graph: Returning a matrix with information on connections between patches

Description

Based on a landscape graph, this function allows the creation of a matrix of Euclidean distances (straight-line pairwise distance between the margins of all the patches), matrix of topological distances (minimum number of connections between any two patches) and adjacency matrix (this a matrix of 0 and 1, showing the adjacency between any two patches, where 0 means that the patches are not connected and 1 means that the patches are connected).

Usage

matrix.graph(rl, mat)

Arguments

rl
Object of class 'landscape'.
mat
mat - one of the following:
  • 'euc_distance' - euclidian distance between patches (edge-to-edge).
  • 'centr_distance' - euclidian distance between patches (centroid-to-centroid).
  • 'adjacency' - adjacency matrix, with values d_ij, taking

Value

  • This function returns a matrix (each one of the specified matrices: Euclidean distance, topological distance and adjacency matrix).

See Also

rland.graph

Examples

Run this code
data(rland)

#Computing matrix of topological distances:

matrix.graph(rl=rland, mat='top_matrix')

Run the code above in your browser using DataLab