Unlimited learning, half price | 50% off
Get 50% off unlimited learning

Overview

The goal of the package mobsim is to facilitate understanding of scale-dependent biodiversity changes.

The package includes functions to simulate species distributions in space with controlled abundance distributions as well as controlled intraspecific aggregation. For analysis there are functions for species rarefaction and accumulation curves, species-area relationships, endemics-area relationships and the distance-decay of community similarity.

A detailed introduction of the package is available at bioRxiv.

Installation

# The easiest way to get mobsim is to install from CRAN:
install.packages("mobsim")

# Or the development version from GitHub:
# install.packages("devtools")
devtools::install_github("MoBiodiv/mobsim", build_vignettes = TRUE)

Please enter bug reports on github.

Getting help

You can get an overview of the available functions in mobsim:

?mobsim

Or have a look at tutorials in the vignette:

browseVignettes("mobsim")

Examples

Here is an example of how to simulate two communities, which just differ in their spatial aggregation of species, but have the same species abundance distribution and the same total number of individuals.

Simulation of communities

library(mobsim)
comm_rand <- sim_poisson_community(s_pool = 30, n_sim = 300)
comm_agg <- sim_thomas_community(s_pool = 30, n_sim = 300, sigma = 0.05, mother_points = 1)
par(mfrow = c(1,2))
plot(comm_rand)
plot(comm_agg)

Analysis of spatially-explicit community data

mobsim mobsim offer functions to analyse spatially-explicit community data. For example the species-area relationship of a community can be easily evaluated.

sar_rand <- divar(comm_rand)
sar_agg <- divar(comm_agg)
plot(m_species ~ prop_area, data = sar_rand, type = "b", log = "xy",
     xlab = "Proportion of area sampled",ylab = "No. of species",
     ylim = c(3,30))
lines(m_species ~ prop_area, data = sar_agg, type = "b", col = 2)
legend("bottomright", c("Random","Aggregated"), col = 1:2, lwd = 2)

Sampling of communities

Simulated or observed communities can be also sampled inorder to test whether biodiversity changes are correctly detected and revealed by any sampling design.

par(mfrow = c(1,2))
samples_rand <- sample_quadrats(comm_rand, avoid_overlap = TRUE)
samples_agg <- sample_quadrats(comm_agg, avoid_overlap = TRUE)

Copy Link

Version

Install

install.packages('mobsim')

Monthly Downloads

231

Version

0.3.2

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Felix May

Last Published

December 5th, 2024

Functions in mobsim (0.3.2)

community_to_sad

Get species abundance distribution from community object
div_rect

Get local diversity indices
plot.community

Plot spatial community object
dist_decay

Distance decay of similarity
plot.dist_decay

Plot distance decay of similarity
divar

Diversity-area relationships
sampling_random_overlap

Creates coordinates (lower left corner of a quadrat) randomly distributed that may overlap each other
plot.divar

----------------------------------------------------------------------------- Plot diversity-area relationships
sampling_random_spatstat

Creates coordinates (lower left corner of a quadrat) randomly distributed but without overlapping each other
abund_rect

----------------------------------------------------------------------------- Get local species abundance distribution
community

Create spatial community object
sampling_one_quadrat

Creates one square quadrat randomly located in the landscape
sample_quadrats

Plot-based samples from a spatially-explicit census
sampling_random_bruteforce

Creates coordinates (lower left corner of a quadrat) randomly distributed but without overlapping each other
rThomas_rcpp

Thomas process individual distribution simulation for one species
sampling_transects

Creates square quadrats aligned along a transect
sim_poisson_community

Simulate community with random spatial positions.
plot.sad

Plot species abundance distributions
sampling_grids

Creates square quadrats aligned on a regular grid
plot.spec_sample_curve

Plot species sampling curves
sim_thomas_community

Simulate community with clumped spatial positions.
rare_curve

Species rarefaction curve
sim_thomas_coords

Simulate clumped spatial coordinates
spec_sample

Sample species richness
spec_sample_curve

Non-spatial and spatially-explicit species sampling curves
sim_poisson_coords

Simulate random spatial coordinates
sim_sad

Simulate species abundance distributions
summary.community

Print summary of spatial community object
summary.sad

Print summary of species abundance distribution object
mobsim-package

mobsim: A package for spatial analysis of scale-dependent biodiversity changes.
dist_decay_quadrats

Distance decay of similarity with user-defined quadrats
div_rand_rect

Distribution of local diversity indices