niches: Generate scenarios for species niches

nichesR Documentation

Generate scenarios for species niches

Description

Generate scenarios for species niches

Usage

niches_custom(
  nsp,
  nr,
  location,
  breadth = 1,
  scale_c = 5e-06,
  scale_e = 2e-07,
  r_use = 5e-04,
  r_lim = matrix(rep(c(0, 1), each = nr), ncol = 2),
  static,
  ratio
)

niches_uniform(nsp = 2, nr = 1, r_lim = c(0, 1), ...)

niches_random(nsp = 2, nr = 1, r_lim = c(0, 1), ratio, ...)

Arguments

nsp

Number of species

nr

Number of resources

location

Location parameter for the niche, see 'details'.

breadth

Niche breadth, see 'details'.

scale_c

Niche height for colonisation, see 'details'.

scale_e

Niche height for extinction, see 'details'.

r_use

Resource use scaling parameter, see 'details

r_lim

Minimum and maximum possible values for each resource dimension; can be a vector in the case of a single resource, otherwise a matrix with 2 columns and nr rows.

static

Vector, the indices of resources that are static, NA if none. Any resources that are not static are by definition dynamic

ratio

A 2-column matrix; each row is the indices of a pair of resources. The ratio of the first to the second will define a single niche dimension. If missing, no ratios used.

...

Additional named niche parameters to override the defaults in niches_custom().

Details

Scenarios handle the complexity of generating niches for you. For custom niches, there is some in allowable parameter values and dimensions. Details follow.

location: Required for custom niches; the location of the niche optimum for each species-resource combination. Must be a matrix with one row per species (nsp), one column per niche axis (nr). For a single niche axis, a vector with one entry per species is also accepted. The location is the mean of the Gaussian colonisation function.

breadth: Niche breadth, or the standard deviation of the Gaussian colonisation function; larger values indicate species can occur in a wider variety of environments. For a single niche dimension, either a scalar (all species have the same breadth) or a vector of length nsp. For multivariate niches, the following are possible:

  • A scalar: all species have the same breadth in each niche dimension

  • A vector of length nsp: each species has a different breadth, but breadth is the same for each niche axis.

  • A vector of length nr: niche breadth varies by axis, but all species have the same breadth for each niche axis. If nr == nsp, then this option is not possible, instead the former applies.

  • A matrix of nsp rows and nr columns: each species-resource combo has a unique breadth, but all resources are orthogonal. In other words, performance for a given resource cannot depend on the concentration of any other resource.

  • A list of length nsp, each element is a square symmetric nr by nr matrix. Similar to the matrix above, but a full variance-covariance matrix is supplied for each species, describing the breadth of the niche along each axis but also how the axes covary.

For ratio niche dimensions, note that nr will be larger than the number of niche dimensions specified in location and breadth. Ratio dimensions will always be inserted at the end of the resource matrix, regardless of the position of the original resources, and it is necessary that the location and breadth parameters reflect this. For example, if the niche dimensions for three resources are the r1:r2 ratio and r3, the location parameter should be of length 2, with the first entry being the location for r3, and the second for r1:r2. To avoid confusion, it is recommended (but not required) that users only construct ratio niches from resources that are specified at the end. Default value 1.

scale_c, scale_e: The (relative) height of the Gaussian colonisation function or the constant extinction function, must be a positive real number. Can be supplied as a scalar (all species have the same scale) or a vector of length nsp. If missing a default value of re-6 (for colonisation) or 2e-7 (for extinction) will be used.

r_use: The scale of resource consumption; larger values indicate faster consumption of resources, see ruf() for more details. This can be a scalar (all species consume all resources at the same rate relative to niche position), a vector of length nsp (species behave differently, but all resources within species are consumed identically), a vector of length nr (all species have identical behaviour, but each resource is consumed at a different rate), or a matrix with nsp rows and nr columns. Note that static resources ignore this parameter. Default value 5e-4.

Value

A list of niche parameters, suitable for passing on to species().

Examples

niches_uniform(nsp = 4)
niches_custom(nsp = 2, nr = 2, location = matrix(c(1,2,3,4), nrow=2))

flee-group/flume documentation built on Jan. 29, 2024, 6:44 p.m.