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

r2dexternal

Generates null models for network analysis by considering external abundances


Description

An extension of r2dtable (and vaznull, respectively) which rescales marginal totals according to independent data

Usage

r2dexternal(N, web, abun.higher=NULL, abun.lower=NULL)

vaznullexternal(N, web, abun.higher=NULL, abun.lower=NULL)

Arguments

N

number of null models to be generated.

web

Web is a matrix representing the interactions observed between higher level species (columns) and lower level species (rows).

abun.higher

Optional vector of externally measured abundances of the higher level. If missing (NULL) it will be replaced by column totals.

abun.lower

Optional vector of externally measured abundances of the lower level. If missing (NULL) it will be replaced by row totals.

Details

The underlying functions are r2dtable and vaznull, which require a vector of row and column totals or a web, respectively. In function nullmodel, these marginal totals are computed from the observed interaction matrix. Here, external abundances can be provided. These will be rescaled and combined with the observed marginal total to construct new row and column vectors for r2dtable.

If neither row nor column abundances are provided this function will be identical to r2dtable and vaznull, respectively.

Value

Returns a list of N null model-generated networks. Species names are (obviously) dropped.

Note

Since the function contains a rounding operation, it also has to include a re-distribution of 1s to keep all species in the system. That means, if one species has been observed in the external abundances extremely rarely (compared to the others), it will be overrepresented in this null model, because otherwise it would have to be dropped altogether! If you have a better solution, please let me know.

Also note that vaznull itself does not return a matrix with exactly the same marginal totals as the input, so don't expect any different from vaznullexternal!

Author(s)

See Also

nullmodel, vaznull, mgen, vegan::simulate and r2dtable

Examples

## Not run: 
	abun.lower <- c(15,5,2,7,4,8,6,0.01,6)
	 set.seed(2)
	(abun.higher <- rpois(27, lambda=4))
	abun.higher[1] <- 0.001
	sum(ext.polls)
	## note: external abundances do not sum up; this is intentional!!
	r2dexternal(2, Safariland, abun.higher=abun.higher, abun.lower=abun.lower)
	r2dexternal(2, Safariland, abun.higher=abun.higher)

  vaznullexternal(2, Safariland, abun.higher=abun.higher, abun.lower=abun.lower)
	
## 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.