nest.smdm: Computes nestedness of a matrix as WNODA (and NODF and WNODF)

View source: R/nest.smdm.R

nest.smdmR Documentation

Computes nestedness of a matrix as WNODA (and NODF and WNODF)

Description

Calculates network nestedness, also within and between modules, i.e. separate nestednesses for nodes belonging to the same module and between nodes belonging to different modules. Three nestedness metrics are implemented in the function: NODF, WNODF and WNODA.

Usage

  nest.smdm(x, constraints=NULL, weighted=FALSE, decreasing="fill", sort=TRUE)
  module2constraints(mod)

Arguments

x

an interaction matrix; typically with rows for lower and columns for higher level species;

constraints

a vector with modules for vertices of the matrix. The vector indicates first rows modules and then columns modules, following the sequence of input matrix x. If no constraints are provided, the function calculates nestedness for the entire matrix, not taking into account possible network modules.

weighted

Logical. Indicate whether to calculate binary or weighted version of the metrics. If set to FALSE for a weighted input matrix, the binary metric is calculated, but a warning is returned.

decreasing

The matrix has to be sorted before computation of (W)NODA. This can be done either by "fill", i.e. sum of cells with non-zero values, or "abund", i.e. sum of cell values. For a binary matrix decreasing needs to be "fill" (as no abundances are available). For weighted matrices, the argument may be "fill" (yielding WNODF) or "abundance" (yielding WNODA).

sort

Logical. Should columns and rows of the matrix be sorted, in order to maximize nestedness index?

mod

Output of a computeModules-object. Returns a vector to be used as input for constraints.

Value

Function returns a list with elements

WNODArow

Nestedness for rows

WNODAcol

Nestedness for columns

WNODAmatrix

Nestedness for entire matrix

If constraints are provided, e.g. based on computeModules, output additionally includes:

WNODA_SM_row

Nestedness for rows belonging to the same modules

WNODA_DM_row

Nestedness for rows belonging to different modules

WNODA_SM_col

Nestedness for columns belonging to the same modules

WNODA_DM_col

Nestedness for columns belonging to different modules

WNODA_SM_matrix

Nestedness for nodes (rows and columns) belonging to the same modules

WNODA_DM_matrix

Nestedness for nodes (rows and columns) belonging to different modules

Author(s)

Rafael Barros Pereira Pinheiro rafael-bpp@hotmail.com, Gabriel Felix, Marco Mello, and the team of the Ecological Synthesis Lab, University of São Paulo

References

Almeida-Neto M, Guimaraes PR, Guimaraes PR Jr, Loyola RD, Ulrich W (2008) A consistent metric for nestedness analysis in ecological systems: reconciling concept and measurement. Oikos 117: 1227–1239

Almeida-Neto, M. & Ulrich, W. (2011). A straightforward computational approach for measuring nestedness using quantitative matrices. Environ. Model. Softw. 26: 173–178

Felix, G.M., Pinheiro, R.B.P., Poulin, R., Krasnov, B.R. & Mello, M.A.R. (2017). The compound topology of a continent-wide interaction network explained by an integrative hypothesis of specialization. bioRxiv

Flores, C.O., Valverde, S. & Weitz, J.S. (2013). Multi-scale structure and geographic drivers of cross-infection within marine bacteria and phages. ISME J. 7: 520–532

See Also

vegan::nestedNODF, computeModules

Examples

nest.smdm(Safariland)
nest.smdm(Safariland, weighted=TRUE)
nest.smdm(Safariland, weighted=TRUE, decreasing="abund")
nest.smdm(Safariland, weighted=TRUE, decreasing="abund", sort=FALSE)
# identify modules using computeModules:
mod <- computeModules(Safariland)
const <- module2constraints(mod)
nest.smdm(Safariland, constraint=const)
nest.smdm(Safariland, constraint=const, weighted=TRUE)

bipartite documentation built on May 29, 2024, 2:23 a.m.