habitat.space: Estimate habitat space using multiple constraining variables

Description Usage Arguments Details Author(s)

View source: R/habitat.space.R

Description

The function estimates a multivariate habitat space for a species. The results of this function can be used in further plotting and suitable habitat estimation functions in the package.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
habitat.space(
  data = NULL,
  cvars,
  log.transform = rep(FALSE, length(cvars)),
  rvar = NULL,
  grid.size = 30,
  grid.limits = NULL,
  method = "kde.binary",
  non.suitable.level = 0.001,
  chull.correction = TRUE,
  sens.n = 100,
  sens.size = 10000,
  sens.grid.size = 500
)

Arguments

data

data.frame containing the data for habitat space estimation. Required except when all limits are set orthogonal.

cvars

A named list defining the constraining variables for the habitat space. Each name refers to a variable name in data unless orthogonal limits are desired. In this case, the name refers to the variable name and the element must be a numeric vector of length two defining the minimum and maximum tolerance, respectively. If this is not the case, the variables are assumed simultaneously limiting and acquired from data. The variables will be plotted in the order given here with the first variable being understood as the x-axis, the second as the y-axis, the third as the z-axis, and so on. At the moment up to three list elements are allowed. This limit may be increased in future releases.

log.transform

A logical vector with the same length than cvars indicating whether the variables should be 10-based logarithm transformed before habitat space estimation.

rvar

a character argument specifying the column name for the response variable if not the same as the constraining variables (cvars). Set to NULL (default) to use the density of constraining variables as a response variable (i.e. presence-only data).

grid.size

a numeric vector equally long as the number of simultaneously constraining variables (dimensions; cvars) defining the grid.size for binning which is required to estimate habitat spaces.

grid.limits

a list of numeric vectors, each of length two defining the minimum and maximum limit for constraining variables (cvars). The list should be the same length length than the number of simultaneously constraining variables. Set to NULL to automatically estimate the limits.

method

a character argument specifying the method for probability estimation for the habitat space. Currently implemented methods:

  • "kde.binary" Multivariate kernel density estimation using a binary probability level to define suitable and not-suitable habitat in the multivariate space. The non.suitable.level argument sets the probability level.

  • "kde.probability" Multivariate kernel density estimation is used to calculate the probability for finding the species in a given region in the habitat space.

  • "foo" Frequencies of occurrence for each bin are used as probabilities for finding the species in a given region in the habitat space. Requires a response variable (rvar). If the response variable is not binary (1 or 0 / TRUE or FALSE, it will be converted to such.

  • "quantile.regression" Multivariate quantile regression. Not implemented yet.

  • function of glm or gam family Multivariate glm or gam object. Not implemented yet.

    Note that setting all limits to orthogonal will lead to a rectangular habitat space and probabilities will not be calculated.

non.suitable.level

a numeric argument defining the KDE probability or frequency of occurrence level for non-suitable habitat. The value can be set between 0 and 1. Defines the edge of the habitat space. Smaller the value, the larger the habitat space.

chull.correction

logical indicating whether convex hull (chull) should be applied to correct concave shapes along the edge of the habitat space.

sens.n

integer defining the number of replicate resamplings (bootstrapping) to be done for the sensitivity estimation. This step makes the function slow. Use 0 to skip the uncertainty estimation.

sens.size

integer defining the number of random samples that should be drawn from data. See the size argument for sample. Should be sufficiently large but lower than number of rows in data. Otherwise, replacing will be used.

sens.grid.size

integer defininf the number of horizonal and vertical grid cells for sensitivity approximation.

Details

The function retunrs only two dimensional habitat spaces at the moment.

Author(s)

Mikko Vihtakari


MikkoVihtakari/SuitableHabitat documentation built on Jan. 30, 2021, 12:50 a.m.