real.niche: Realised Niche

Description Usage Arguments Details Value References See Also Examples

View source: R/real-niche.R

Description

Calculates the n-dimensional realised niche for a community of s species at m coordinates in niche space.

Usage

1
real.niche(niche.coords, community, interactions)

Arguments

niche.coords

A m-by-n matrix of niche coordinates.

community

List of length s containing definitions of the fundamental niches of species in the community.

interactions

A s-by-s matrix that defines the species interspecific interactions.

Details

The first step in calculating the realised niches is to calculate a fundamental niche for each species in the community list. This is done using the fund.niche function, so see there for a full description of how to define a the species fundamental niches.

The interactions matrix defines the form of the ecological interaction between each of the species in the community. These interactions can be either positive (+) or negative (-) in effect, and as the interactions can be asymmetrical there are a range of possible interspecific species interactions: competition (–), predator-prey or parasite-host (+-), commensalism (+0), amensalism (-0), or mutualism (++). When building the interactions matrix row 1 column 2 is the effects of species 2 on species 1, and conversely row 2 column 1 is the effects of species 1 on species 2, etc.

Please note that this function assumes that the species are consistently ordered in the community list and interactions matrix, and that no species effects itself so the diagonal of the interactions matrix has values equal to zero.

Value

Returns a m-by-s matrix realised niche value for each species at each of the input niche space coordinates.

References

Etherington TR, Omondiagbe OP (2019) virtualNicheR: generating virtual fundamental and realised niches for use in virtual ecology experiments. Journal of Open Source Software 4:1661 https://doi.org/10.21105/joss.01661

See Also

Uses fund.niche

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Define the community
species1 = list(2.5, matrix(c(25, 100)), matrix(data=c(9, 60,
                                                       60, 625), nrow=2, ncol=2, byrow=TRUE))
species2 = list(5.0, matrix(c(28, 110)), matrix(data=c(4, -20,
                                                      -20, 500), nrow=2, ncol=2, byrow=TRUE))
species3 = list(3.0, matrix(c(25, 80)), matrix(data=c(4, 0,
                                                      0, 150), nrow=2, ncol=2, byrow=TRUE))
community = list(species1, species2, species3)

# Define the interactions
interactions = matrix(data=c(0.0, 0.2,-0.4,
                            -1.0, 0.0,-1.0,
                            -0.6, 0.3, 0.0), nrow=3, ncol=3, byrow = TRUE)

# Calculate the realised niche values
niche.XY = niche.grid.coords(mins=c(15,0), maxs=c(35,200), nCoords=121)
realNiche = real.niche(niche.XY, community, interactions)

# Plot the realised niche for species 1
realNiche1 = matrix(realNiche[,1], nrow=length(unique(niche.XY[,1])))
nContour = 10
filled.contour(unique(niche.XY[,1]), unique(niche.XY[,2]), realNiche1,
               levels = seq(0, 5, 5/nContour),
               col=colorRampPalette(c("gold", "firebrick"))(nContour),
               xlab=expression(paste("Temperature (", degree, "C)")),
               ylab="Rainfall (mm)",
               main ="Realised niche",
               key.title = title(main = expression(lambda)))

virtualNicheR documentation built on March 26, 2020, 6:28 p.m.