View source: R/get_overlap_matrix.R
get_overlap_matrix | R Documentation |
given a matrix with focal species in columns and resources in rows, calculates the overlap among the focal species in resource use, considering either binary or quantitative resource use (e.g. number of visits). aij is the effect of j over i, the relative number of resources/visits from i that are shared with j. note that song et al. 2018 ecol.lett. do a column-wise sum, and that is not correct. In addition, their normalization includes the diagonal elements, which is also incorrect.
get_overlap_matrix(A, mask, quant = FALSE, relative.diag = FALSE)
A |
Matrix of resource use. Focal species in columns, resources in rows. Can be binary (e.g. an adjacency matrix) or quantitative (e.g. number of visits to different plant species). |
mask |
Matrix of potential overlap. 0 for pairs that do not overlap, and a value 0-1 for species with different degrees of potential overlap (e.g. because of phenological constraints). Needs to be of the same dimensions as A, otherwise it will fail without warning. |
quant |
whether we want to obtain binary or quantitative overlap |
relative.diag |
whether the overlap of a species with itself is 1 (relative.diag = FALSE) or, the overlap of i is relative to the overlap of other species. In this case, assume the species with maximum abundance has an overlap of 1, and the rest are relative to that. This parameter only affects quantitative matrices. |
overlap matrix, of NxN dimensions
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.