get_overlap_matrix: Overlap in links/frequency between species pairs

View source: R/get_overlap_matrix.R

get_overlap_matrixR Documentation

Overlap in links/frequency between species pairs

Description

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.

Usage

get_overlap_matrix(A, mask, quant = FALSE, relative.diag = FALSE)

Arguments

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.

Value

overlap matrix, of NxN dimensions


RadicalCommEcol/MultitrophicFun documentation built on Oct. 13, 2023, 1:27 a.m.