rSpCommunity: Random Spatialized Community

View source: R/SpCommunity.R

rSpCommunityR Documentation

Random Spatialized Community

Description

This function extends rCommunity by spatializing the randomized community.

Usage

rSpCommunity(
  n,
  size = sum(NorP),
  NorP = 1,
  BootstrapMethod = "Chao2015",
  S = 300,
  Distribution = "lnorm",
  sd = 1,
  prob = 0.1,
  alpha = 40,
  Spatial = "Binomial",
  scale = 0.2,
  mu = 10,
  win = spatstat.geom::owin(),
  Species = NULL,
  Sizes = "Uniform",
  MinSize = 1,
  MaxSize = 1,
  MeanSize = 20,
  Wscale = 20,
  shape = 2,
  CheckArguments = TRUE
)

Arguments

n

The number of communities to draw.

size

The number of individuals to draw in each community.

NorP

A numeric vector or a two-column matrix. Contains either abundances or probabilities. Two-column matrices should contain the observed abundances (or probabilities) in the first column and the expected ones in the second column, to allow using beta diversity functions.

BootstrapMethod

The method used to obtain the probabilities to generate bootstrapped communities from observed abundances. If "Marcon", the probabilities are simply the abundances divided by the total number of individuals \insertCiteMarcon2012aSpatDiv. If "Chao2013" or "Chao2015" (by default), a more sophisticated approach is used (see as.ProbaVector) following \insertCiteChao2013;textualSpatDiv or \insertCiteChao2015;textualSpatDiv.

S

The number of species.

Distribution

The distribution of species frequencies. May be "lnorm" (log-normal), "lseries" (log-series), "geom" (geometric) or "bstick" (broken stick).

sd

The simulated distribution standard deviation. For the log-normal distribution, this is the standard deviation on the log scale.

prob

The probability of success in each trial.

alpha

Fisher's alpha.

Spatial

The spatial distribution of points. May be "Binomial" (a completely random point pattern except for its fixed number of points) or "Thomas" for a clustered point pattern with parameters scale and mu.

scale

In Thomas point patterns, the standard deviation of random displacement (along each coordinate axis) of a point from its cluster center.

mu

In Thomas point patterns, the mean number of points per cluster. The intensity of the Poisson process of cluster centers is calculated as the number of points (size) per area divided by mu.

win

The window containing the point pattern. It is an owin object.

Species

A vector of characters or of factors containing the possible species.

Sizes

The distribution of point sizes. May be "Uniform" for a uniform distribution between MinSize and MaxSize. By default, all sizes are 1. May be "Weibull" with parameters MinSize, Wscale and shape.

MinSize

The minimum size in a uniform or Weibull distribution.

MaxSize

The maximum size in a uniform distribution.

MeanSize

The mean size in an exponential distribution (i.e. the negative of the inverse of the rate).

Wscale

The scale parameter in a Weibull distribution.

shape

The shape parameter in a Weibull distribution.

CheckArguments

If TRUE (default), the function arguments are verified. Should be set to FALSE to save time in simulations for example, when the arguments have been checked elsewhere.

Value

A wmppp.object, with PointType values as species names if n=1. An object of class "SpCommunities", which is a list of wmppp.objects, is returned if n>1.

References

\insertAllCited

Examples

spCommunity <- rSpCommunity(1, size=30, S=5)
autoplot(spCommunity)


EricMarcon/SpatDiv documentation built on May 25, 2023, 12:54 p.m.