elgrin: Teasing apart the effects of environmental variations and...

View source: R/elgrin.R

elgrinR Documentation

Teasing apart the effects of environmental variations and biotic interactions on species distributions

Description

ELGRIN jointly models the presence and absence of all species in a given area in function of environmental covariates and the topological structure of the known metaweb

Usage

elgrin(presence, metaweb, environmentvar, ncores=1)

Arguments

presence

A matrix with presence/absence of species (rows) at different locations (columns), coded in 0/1 format (1 for presence).

metaweb

A matrix or a igraph object. This represents the metaweb/metawnetwork of interactions as an adjacency matrix or as a graph respectively.

environmentvar

A matrix with environmental variables (columns) at different locations (rows).

ncores

The number of cores to use, i.e. at most how many threads will run simultaneously. Default is 1 (no parallelization).

Details

ELGRIN (in reference to Charles Elton and Joseph Grinnell) can handle the effects of both environmental factors and known ecological interactions (aka a metanetwork) on species distributions. We rely on Markov random fields, a family of flexible models that can handle dependencies between variables using a graph.

Value

elgrin returns an object of class list with the following components:

a

A vector of species intercepts.

al

A vector of location intercepts.

b

A matrix of linear environmental parameters.

c

A matrix of quadratic environmental parameters.

betaPres

A vector of co-presence strength (or avoidance when <0) at each location.

betaAbs

A vector of co-absence strength (or avoidance when <0) at each location.

compat

A matrix with niche compatibility of species (rows) at different locations (columns), coded in 0/1 format (1 for compatibility)..

Author(s)

Authors: Vincent Miele Maintainer: Vincent Miele <vincent.miele@univ-lyon1.fr>

References

Vincent Miele, Catherine Matias, Marc Ohlmann, Giovanni Poggiato, St ephane Dray and Wilfried Thuiller, Quantifying the overall effect of biotic1interactions on species communities along2environmental gradients, arXiv <doi:10.48550/arXiv.2103.10433>

Examples

data(virtualComCompetition)
vcom <- virtualComCompetition

result <- elgrin(vcom$presence, vcom$metaweb, vcom$environmentvar)
str(result)

plot(result$betaPres, result$betaAbs, xlab="Co-presence", ylab="Co-absence")
abline(h=0, col=2)
abline(v=0, col=2)


econetwork documentation built on Oct. 21, 2022, 5:10 p.m.