betadiv_phylogenetic {epm}R Documentation

Map phylogenetic turnover in species communities

Description

Multisite phylogenetic community dissimilarity is calculated for each cell within a circular moving window of neighboring cells. To implement a custom function, see customBetaDiv.

Usage

betadiv_phylogenetic(
  x,
  radius,
  component = "full",
  focalCoord = NULL,
  slow = FALSE,
  nThreads = 1
)

Arguments

x

object of class epmGrid.

radius

Radius of the moving window in map units.

component

which component of beta diversity to use, can be "turnover", "nestedness" or "full"

focalCoord

vector of x and y coordinate, see details

slow

if TRUE, use an alternate implementation that has a smaller memory footprint but that is likely to be much slower. Most useful for high spatial resolution.

nThreads

number of threads for parallelization

Details

For each cell, multisite dissimilarity is calculated for the focal cell and its neighbors. If focalCoord is specified, then instead of multisite dissimilarity within a moving window of gridcells, pairwise dissimilarity is calculated from the cell at the focal coordinates, to all other cells.

All metrics are based on Sorensen dissimilarity and range from 0 to 1: For each metric, the following components can be specified. These components are additive, such that the full metric = turnover + nestedness.

If the R package spdep is installed, this function should run more quickly.

Value

Returns a sf polygons object (if hex grid) or a SpatRaster object (if square grid) with multisite community dissimilarity for each grid cell.

Author(s)

Pascal Title

References

Baselga, A. The relationship between species replacement, dissimilarity derived from nestedness, and nestedness. Global Ecology and Biogeography 21 (2012): 1223–1232.

Leprieur, F, Albouy, C, De Bortoli, J, Cowman, PF, Bellwood, DR & Mouillot, D. Quantifying Phylogenetic Beta Diversity: Distinguishing between "True" Turnover of Lineages and Phylogenetic Diversity Gradients. PLoS ONE 7 (2012): e42760–12.

Examples


tamiasEPM

tamiasEPM <- addPhylo(tamiasEPM, tamiasTree)

# phylogenetic turnover
beta_phylo_turnover <- betadiv_phylogenetic(tamiasEPM, radius = 70000,
		component = 'turnover')
beta_phylo_nestedness <- betadiv_phylogenetic(tamiasEPM, radius = 70000,
		component = 'nestedness')
beta_phylo_full <- betadiv_phylogenetic(tamiasEPM, radius = 70000,
		component = 'full')

oldpar <- par(mfrow=c(1,3))
plot(beta_phylo_turnover, reset = FALSE, key.pos = NULL)
plot(beta_phylo_nestedness, reset = FALSE, key.pos = NULL)
plot(beta_phylo_full, reset = FALSE, key.pos = NULL)

# using square grid epmGrid
tamiasEPM2 <- createEPMgrid(tamiasPolyList, resolution = 50000,
	cellType = 'square', method = 'centroid')
tamiasEPM2 <- addPhylo(tamiasEPM2, tamiasTree)

beta_phylo_full <- betadiv_phylogenetic(tamiasEPM2, radius = 70000,
		component = 'full')
beta_phylo_full_slow <- betadiv_phylogenetic(tamiasEPM2, radius = 70000,
		component = 'full', slow = TRUE)

par(mfrow = c(1,2))
terra::plot(beta_phylo_full, col = sf::sf.colors(100))
terra::plot(beta_phylo_full_slow, col = sf::sf.colors(100))

# dissimilarity from a focal cell
focalBeta <- betadiv_phylogenetic(tamiasEPM, radius = 70000,
		component = 'full', focalCoord = c(-1413764, 573610.8))
plot(focalBeta, reset = FALSE)
points(-1413764, 573610.8, pch = 3, col = 'white')

par(oldpar)


[Package epm version 1.1.2 Index]