Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

nestedness

Calculates nestedness temperature of presence/absence matrices


Description

Calculates matrix temperature using the binmatnest programm of Miguel Rodríguez-Gironés

Usage

nestedness(m, null.models = TRUE, n.nulls = 100, popsize = 30, 
n.ind = 7, n.gen = 2000, binmatnestout=FALSE)

Arguments

m

m is the matrix object for which the temperature is calculated. m will be converted to a binary matrix as temperature is only based on binary data

null.models

Logical; shall the three different null models to check for significance of the matrix temperature be calculated? The null models procedure is quite time consuming and therefore we added this switch. Defaults to null.models=TRUE.

n.nulls

How many null models should be calculated. Defaults to n.nulls=100.

popsize

For the genetic algorithm some parameters have to be initialised. First is popsize, default is 30

n.ind

Second is number of individuals picked for the next generation. Default of n.ind is 7.

n.gen

Third is the number of generations until the genetic algorithm stops. Default of n.gen is 2000.

binmatnestout

if set to TRUE a file "binmat.out" is saved in the current working directory , which stores the original binmatnest output

Details

There are several implementations of nestedness-calculators, most noticeably NTC (nestedness temperature calculator), BINMATNEST and aninhado (check Wikipedia's entry on the subject: https://en.wikipedia.org/wiki/Nestedness). While we here use BINMATNEST, this does not disqualify any of the others. Miguel was simply the first we contacted and he was readily willing to share his code.

Here we use BINMATNEST by calling a tweaked version of the C++ program binmatnest. In principle nestedness temperature is calculated by using a line of perfect order (using a genetic algorithm) to determine the reordering of rows and columns that leads to minimum matrix temperature of given size and fills. The deviation from this minimun temperature is the matrix temperature. In addition nestedness uses different null models to check for statistical significance of the matrix temperature. For details on what BINMATNEST does different, and better, than the original NTC see reference below.

Notice also that the original software BINMATNEST is available as a stand-alone application, too. Check out Miguel's homepage: http://www.eeza.csic.es/eeza/personales/rgirones.aspx

Value

returns a list of matrix descriptors, such as

temperature

the matrix temperature

parameters of genetic algorithms

Parameters used for the genetic algorithm

nullmodels

switch if null models have been calculated, 1 for yes, 0 for no

p, mean, var

probability, mean temperature and variance of temperature for the three different null models

packing order

the packing order of the most packed matrix (minimum temperature of a perfectly nested matrix using given size and fills.

Note

Make sure matrix m is valid, as error proofing in the C++ function does not fully work, and therefore it is possible that R may crash when using strange types of matrices, such as matrices with only one entry.

Also, while this function returns exactly the same values as binmatnest, there seems to be the occasional glitch in the software, in that in inexplicable circumstances the matrix is inverted before calculating nestedness. We are currently trying to find the cause of this problem. Sorry!

In the meantime, use nestedtemp in vegan (as we do in networklevel)!

Author(s)

Bernd Gruber, based on C++-code by Miguel Rodriguez-Girones.

References

Rodríguez-Gironés M.A., and Santamaría L. 2006. A new algorithm to calculate the nestedness temperature of presence-absence matrices. Journal of Biogeography 33, 924–935

Examples

## Not run: 
	data(vazarr)
	nestedness(vazarr) # null models are calculated
	# no null models, much faster for bigger matrices:
	nestedness(vazarr, null.models=FALSE) 
	nestedness(vazarr, n.nulls=300, n.gen=300)
	
## End(Not run)

bipartite

Visualising Bipartite Networks and Calculating Some (Ecological) Indices

v2.16
GPL
Authors
Carsten F. Dormann, Jochen Fruend and Bernd Gruber, with additional code from Stephen Beckett, Mariano Devoto, Gabriel Felix, Jose Iriondo, Tove Opsahl, Rafael Pinheiro, Rouven Strauss and Diego Vazquez, also based on C-code developed by Nils Bluethgen, Aaron Clauset/Rouven Strauss and Miguel Rodriguez-Girones
Initial release
2021-02-08

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.