knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

BetaVolume

The goal of BetaVolume is to provides a new measure of beta diversity based on the geometric embedding of metacommunities.

Installation

You can install the development version of BetaVolume from GitHub with:

# install.packages("devtools")
devtools::install_github("clsong/betavolume")

Example

Here we show a basic example of this package.

library(BetaVolume)
library(tidyverse)

We analyze an empirical metacommunity collected collected by A. H. Gentry and numerous additional collectors. This metacommunity has 37 species and 10 patches.

head(example_meta_composition)

As this data only contains information of presence/absence of species, we adopt the duplication schemes to compute hypervolume beta diversity. The hypervolume beta diversity of this metacommunity is

betavolume(example_meta_composition, weights = T)

We can disentangle the individual contribution of a patch to the overall beta diversity. We find that

disentangle_individual_contribution(example_meta_composition, weights = T) %>% 
  enframe(name = "species", value = 'contribution') %>% 
  arrange(-contribution)


clsong/BetaVolume documentation built on Jan. 4, 2023, 1:07 p.m.