Skip to contents

Presence records come from the conditions that M offers, and M rarely offers them evenly: a climate common in M will be sampled often whatever the species prefers, and one that M offers in a few cells will be sampled rarely even if the species thrives there. Uneven availability of climates inside the calibration area therefore biases the estimated niche (Jimenez & Soberon 2022). m_availability() is the continuous analogue of m_class_shares(): for each predictor, it divides the range of the records' values into bins equal bins and compares the share of M's cells in each bin with the share an even spread over M's range would give.

Usage

m_availability(
  env,
  records,
  m = NULL,
  bins = 20,
  thin_ratio = 0.25,
  min_well = 0.8,
  min_even = 0.7,
  n = 1e+05,
  coords = NULL,
  points_crs = "EPSG:4326",
  seed = 1
)

Arguments

env

Predictor layers (terra::SpatRaster or files), clipped to M or covering it.

records

Records: a data.frame with coordinates, a CSV path, sf or terra::SpatVector.

m

Optional M: an m_area from delimit_m() or polygons; cells outside it are ignored. NULL when env is already clipped to M.

bins

Number of bins over the records' range of each predictor.

thin_ratio

Ratio below which a bin is thinly represented.

min_well, min_even

Limits of well_represented and evenness below which a variable is flagged.

n

Cells of M sampled.

coords, points_crs

Coordinate columns and their CRS.

seed

Random seed.

Value

An object of class m_availability: variables (one row per predictor: records' range, well_represented, thin, complete, evenness, distorted and reason), bins (per predictor and bin: lower, upper, m_share, even_share, ratio, records) and settings. See plot_m_availability().

Details

  • ratio (per bin, in bins): observed / even share; 1 = as available as an even spread, 0.1 = a tenth of it.

  • well_represented: the share of the records' range in bins with ratio of at least thin_ratio (default 0.25); the rest is thinly represented.

  • complete: the share of the records' range in which M has any cell (records outside M's range, or gaps).

  • evenness: Pielou's evenness of M's cells over the bins of the records' range (1 = even).

  • distorted: well_represented below min_well (default 0.8), complete below 1, or evenness below min_even (default 0.7); M then gives a distorted view of the availability of that variable.

For a flagged variable, read its response curve with care: the records are thin where M is thin. Jimenez & Soberon (2022) weight the likelihood of the records by the availability of their conditions to estimate the fundamental niche; other remedies are a larger or differently shaped M, or a background stratified in environmental space (sample_background() with method = "envstrat").

Assumptions and limits. Availability is judged one predictor at a time over the records' range, so a combination of conditions can be rare in M although each variable is evenly available. The limits for a distorted view are preENM defaults, not from the literature.

References

Jimenez, L., Soberon, J. (2022) Estimating the fundamental niche: accounting for the uneven availability of existing climates in the calibration area. Ecological Modelling 464, 109823. doi:10.1016/j.ecolmodel.2021.109823

Examples

sim <- simulate_enm_data(seed = 1, n_presence = 100)
av <- m_availability(sim$env, sim$presence)
av
#> Availability of the records' conditions in M: 2 predictor(s), 100 records, 4800 cells of M
#> 
#> IN SHORT
#> - M offers the records' range of every predictor fairly evenly: at least
#>   80% of each range is well represented.
#> 
#>  layer rec_min rec_max well_represented complete evenness distorted
#>   env1 0.09380   0.994                1        1    0.997     FALSE
#>   env2 0.00833   0.892                1        1    0.995     FALSE
#> 
#> The records' range of each predictor is cut into 20 equal bins; ratio =
#> share of M's cells in a bin / the share an even spread over M's range would
#> give. well_represented = share of the range in bins with ratio of at least
#> 0.25; complete = share with any cell of M; evenness = Pielou's evenness of
#> M's cells over the bins. Flagged when well_represented < 0.8, complete < 1
#> or evenness < 0.7: preENM defaults, not from the literature.
plot_m_availability(av)