Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


⚠️There's a newer version (3.0.0) of this package.Take me there.

mobr

Measurement of Biodiversity in R

This repository hosts an R package that is actively being developed for estimating biodiversity and the components of its change. The key innovations of this R package over other R packages that also carry out rarefaction (e.g., vegan, iNext) is that mobr is focused on 1) making empirical comparisons between treatments or gradients, and 2) our framework emphasizes how changes in biodiversity are linked to changes in community structure: the SAD, total abundance, and spatial aggregation.

The concepts and methods behind this R package are described in three publications.

McGlinn, D.J. X. Xiao, F. May, N.J Gotelli, T. Engel, S.A Blowes, T.M. Knight, O. Purschke, J.M Chase, and B.J. McGill. 2019. MoB (Measurement of Biodiversity): a method to separate the scale-dependent effects of species abundance distribution, density, and aggregation on diversity change. Methods in Ecology and Evolution. 10:258–269. https://doi.org/10.1111/2041-210X.13102

McGlinn, D.J. T. Engel, S.A. Blowes, N.J. Gotelli, T.M. Knight, B.J. McGill, N. Sanders, and J.M. Chase. 2020. A multiscale framework for disentangling the roles of evenness, density, and aggregation on diversity gradients. Ecology. https://doi.org/10.1002/ecy.3233

Chase, J.M., B. McGill, D.J. McGlinn, F. May, S.A. Blowes, X. Xiao, T. Knight. 2018. Embracing scale-dependence to achieve a deeper understanding of biodiversity and its change across communities. Ecology Letters. 21: 1737–1751. https://doi.org/10.1111/ele.13151

Please cite mobr. Run the following to get the appropriate citation for the version you're using:

citation(package = "mobr")

Installation

install.packages('mobr')

Or, install development version

install.packages('devtools')
library(devtools)

Now that devtools is installed you can install `mobr using the following R code:

install_github('MoBiodiv/mobr')

Examples

The package vignette provides a useful walk-through the package tools, but below is some example code that uses the two key analyses and related graphics.

library(mobr)
data(inv_comm)
data(inv_plot_attr)
inv_mob_in = make_mob_in(inv_comm, inv_plot_attr, coord_names = c('x', 'y'))
inv_stats = get_mob_stats(inv_mob_in, 'group', ref_level = 'uninvaded')
plot(inv_stats)
inv_deltaS = get_delta_stats(inv_mob_in, 'group', ref_level='uninvaded',
                             type='discrete', log_scale=TRUE, n_perm = 5)
plot(inv_deltaS, 'b1')

Meta

  • Please report any issues or bugs.
  • License: MIT
  • Get citation information for mobr in R doing citation(package = 'mobr')
  • Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Thanks

  • Gregor Seyer for providing a constructive review of our CRAN submission
  • Kurt Hornik for helping us keep up with CRAN changes.

Copy Link

Version

Install

install.packages('mobr')

Monthly Downloads

198

Version

2.0.2

License

MIT + file LICENSE

Maintainer

Daniel McGlinn

Last Published

February 10th, 2021

Functions in mobr (2.0.2)

make_mob_in

Create the 'mob_in' object.
groups_panel1

Panel function for gamma-scale results
plot.mob_out

Plot the multiscale MoB analysis output generated by get_delta_stats.
get_rand_sad

Randomly sample of a relative abundance distribution (RAD) to produce an expected species abundance distribution (SAD)
mod_sum

Extract coefficients and metrics of fit from model
get_delta_stats

Conduct the MoB tests on drivers of biodiversity across scales.
tank_comm

Cattle tank data set
compare_samp_rarefaction

Compare all sample-based curves (random, spatially constrained-k-NN, spatially constrained-k-NCN)
get_ind_dens

Auxiliary function for get_delta_stats() Returns the "assumed" density of individuals in a plot given whether min, max or mean is used
get_delta_curves

Auxiliary function for computing S and the effect on S of the three components of community structure: SAD, N, and aggregation
get_group_delta

Get gamma-scale differences
centroid_accumulate

Internal function used by kNCN_average to compute the k-NCN algorithm starting with a specified focal sample
mobr

Measurement of Biodiversity in R
inv_comm

Invasive plants dataset
plot_rarefaction

Plot rarefaction curves for each treatment group
plot_abu

Plot distributions of species abundance
print.mob_in

Print a shortened version of the mob_in object
kNCN_average

Construct spatially constrained sample-based rarefaction (sSBR) curve using the k-Nearest-Centroid-neighbor (k-NCN) algorithm
get_null_comm

Generate a null community matrix
plot.mob_stats

Plot alpha- and gamma-scale biodiversity statistics for a MoB analysis
calc_biodiv

Calculate biodiversity statistics from sites by species table.
get_overall_p

Auxiliary function for effect_ functions Compute an overall p-value for one factor in the discrete case p-value is based on mean squared difference from zero summed across the scales Method developed by Loosmore and Ford 2006 but algebraic simplifications used as developed by Baddeley et al. 2014 Ecological Archives M084-017-A1
plotStacked

Stacked plot by Marc Taylor (@marchtaylor on gitHub)
calc_chao1

Estimation of species richness
rarefaction

Rarefied Species Richness
sphere_dist

Internal function for distance matrix assuming inputs are longitude and latitudes on a spherical Earth.
subset.mob_in

Subset the rows of the mob data input object
samples_panel1

Panel function for alpha-scale results
get_F_values

Get F statistics from diversity indices and grouping vector
avg_nn_dist

Compute average nearest neighbor distance
groups_panel2

Panel function for gamma-scale results with confidence intervals
calc_PIE

Calculate probability of interspecific encounter (PIE)
fire_comm

Fire data set
plot_N

Plot the relationship between the number of plots and the number of individuals
get_mob_stats

Calculate sample based and group based biodiversity statistics.
get_inds

Auxiliary function for get_delta_stats() Returns a vector of abundances where individual-based rarefaction will be performed
ind_rare_perm

Compute permutation derived individual-based rarefaction curves