spat.beta {divraster}R Documentation

Spatial beta diversity for raster

Description

Calculates spatial beta diversity for taxonomic (TD), functional (FD), and phylogenetic (PD) dimensions. See raster.beta.

Usage

spat.beta(x, tree, filename = "", func = "jaccard", abund = FALSE, ...)

Arguments

x

A SpatRaster with presence-absence data (0 or 1) for a set of species. (This maps to layers in BAT::raster.beta).

tree

It can be a 'data.frame' with species traits or a 'phylo' with a rooted phylogenetic tree. Species names in 'tree' and 'x' must match!

filename

Character. Save results if a name is provided.

func

Character. Distance function for beta diversity calculation. Defaults to "jaccard". Passed to BAT::beta.

abund

Logical. Whether to use abundance data (TRUE) or presence-absence (FALSE). Defaults to FALSE. Passed to BAT::beta.

...

Additional arguments to be passed to internal functions within BAT::raster.beta (e.g., BAT::beta). Note: BAT::raster.beta does not accept a 'neighbour' argument.

Value

A SpatRaster with beta results (total, replacement, richness difference, and ratio).

Examples


library(terra)
bin1 <- terra::rast(system.file("extdata", "fut.tif",
package = "divraster"))
traits <- read.csv(system.file("extdata", "traits.csv",
package = "divraster"), row.names = 1)
tree <- ape::read.tree(system.file("extdata", "tree.tre",
package = "divraster"))
spat.beta(bin1)
spat.beta(bin1, traits)
spat.beta(bin1, tree)


[Package divraster version 1.2.1 Index]