Terraflux Terraflux
Download

Species distributions

34 operators. Inputs marked required must be connected or given; the others have defaults.

sdm.accessible_area#

The area the species could have reached, where its background is drawn (landschaft's accessible_area, the M of the BAM diagram): the land within a distance of the records (geodesic circles, merged), their convex hull or the regions that hold them (widened by the distance if given), cut at the antimeridian, within a mask.

InputTypeWhat it is
occurrencesrequiredanypoints, or a table with coordinate columns
regionsvectorpolygons (ecoregions, biomes...), for regions
withinvectorpolygons the area is cut to
OutputTypeWhat it is
areavectorone (multi)polygon in lon/lat
SettingTypeWhat it is
xtextthe table's x column (default x, lon, longitude...)
ytextthe table's y column (default y, lat, latitude...)
methodtextbuffer (default), convex_hull or regions
distancenumberthe radius in metres (required for buffer)
resolutionintegerthe vertices of each circle (default 64)

sdm.area_of_habitat#

The area of habitat of species (Brooks et al. 2019; Strassburg et al. 2020): over the cells of each species' range (within its elevation limits), the shares of the natural classes suitable to it times the cell's area, now and before conversion (the original vegetation); and the habitat it gains per unit of a cell restored. Rows in the order of the ranges' layers.

InputTypeWhat it is
rangesrequiredstackeach species' range (cells above 0), by species
land_coverrequiredstackthe share of each class, by name
originalstackthe original share of each natural class
restorestackthe shares restored land returns to
anthropicmapthe share of anthropic land (where restoring gains)
elevationmapthe elevation, for the species' limits
OutputTypeWhat it is
tabletableper species (in the ranges' order): its area of habitat now and potential (km²), its range's cells, and whether it counts (1: habitat now and potential, and suitable classes)
gainstackthe habitat each species gains per unit of a cell restored
lossstackwith loss: the habitat each species loses per unit of a cell's natural land converted
SettingTypeWhat it is
naturalrequiredanythe natural classes (names of the land cover's layers)
suitabilityanyeach species' suitable classes: {species: [classes]} (the species not listed: every natural class)
include_unlistedboolspecies not in suitability count (default true)
elevation_limitsany[[species, lowest, highest], ...] (null: none)
cell_areanumbera cell's area in km² (default: the grid's)
lossboolalso the habitat lost per unit of natural land (conservation, conversion)

sdm.autocorrelation_range#

The range of spatial autocorrelation of the predictors (landschaft's autocorrelation_range, blockCV's cv_spatial_autocor): gstat's variograms (spherical, exponential, Gaussian and Matern) fitted to a sample of every layer, the best one's range; their median and the block size it gives for spatial blocks.

InputTypeWhat it is
envrequiredanythe predictors: a stack or a map
OutputTypeWhat it is
rangenumberthe median range (metres on lon/lat grids)
block_sizenumberthe size of spatial blocks (degrees on lon/lat grids)
layerstableper layer: range, sill, nugget, kappa
modelsanyper layer, the variogram model
SettingTypeWhat it is
nintegerthe cells sampled per layer (default 5000)
seedintegerthe seed of R's generator (default 1)
deg_to_metrenumbermetres per degree on lon/lat (111325)

sdm.background#

Background points for a species distribution model (landschaft's background, dismo's randomPoints): cells with values in every predictor drawn with R's sampling (weighted by the cells' widths on lon/lat grids, or by a bias), within an area, a band of distances from the records or outside their environmental envelope, the records' cells left out.

InputTypeWhat it is
envrequiredanythe predictors: a stack or a map
occurrencesanythe records (points or a table)
areavectorthe area to draw within
biasmapa weight per cell
OutputTypeWhat it is
pointsvectorthe points at the cells' centres, with their cell
SettingTypeWhat it is
xtextthe table's x column (default x, lon, longitude...)
ytextthe table's y column (default y, lat, latitude...)
nintegerthe points (default 10000)
distanceanythe largest distance from the records, or [from, to]
envelopenumberoutside the records' quantiles [q, 1 - q] of every predictor
exclude_occurrencesboolleave the records' cells out (default true)
tryfnumberthe candidates drawn per point (default 3)
lonlat_correctionboolweight lon/lat cells by their width (default true)
seedintegerthe seed of R's generator (default 1)

sdm.bias_surface#

The sampling effort as a surface (landschaft's bias_surface): a Gaussian kernel density of the records of a whole group (the same taxa, collectors and decades) on the grid of the predictors, MASS::kde2d's at the cells' centres, with R's bw.nrd in each direction by default. The bias of sdm.background, which draws the background with the records' bias (a target-group background, Phillips et al. 2009; Maxent's bias file). kde2d(h = H) is bandwidth = H / 4.

InputTypeWhat it is
occurrencesrequiredanythe records of the target group: points, or a table with coordinate columns
envrequiredanythe predictors: a stack or a map (its grid)
OutputTypeWhat it is
biasmapthe density (the share of the records per unit of area of the coordinate system: it sums to 1 over the plane) or rescaled
bandwidthanythe bandwidths used, [x, y]
SettingTypeWhat it is
xtextthe table's x column (default x, lon, longitude...)
ytextthe table's y column (default y, lat, latitude...)
bandwidthanythe kernel's standard deviation in the grid's units (metres, or degrees on lon/lat): a number, [x, y], or nrd (default: R's bw.nrd in each direction, kde2d's)
isotropicboolthe larger bandwidth in both directions (default false)
limitsany[min, max]: bandwidths raised or lowered to them (either null); a floor keeps a clustered group's surface from collapsing on its records
weightstexta column of the records: each one's weight (specimens, visits); default 1
rescaleany[lo, hi]: the densities mapped linearly to them, e.g. [0.05, 0.95], so that every cell keeps a chance
maskboolno value on the cells without a value in every predictor (default true)

sdm.boyce#

The continuous Boyce index (landschaft's boyce, ecospat's ecospat.boyce): the correlation between the classes of suitability and their ratio of predicted to expected presences, in a moving window (default) or in classes.

InputTypeWhat it is
presencesrequiredanythe predictions at the presences
availablerequiredanythe predictions everywhere (or at the background and the presences)
OutputTypeWhat it is
cornumberthe index (rounded to 3 digits)
tabletablethe classes: f_ratio, hs, used
SettingTypeWhat it is
columntextthe tables' column of the predictions (default the first)
nclassany0 (default, a moving window), a number of classes or their breaks
windownumberthe window's width (default a tenth of the range)
resintegerthe window's steps (default 100)
methodtextspearman (default), pearson or kendall
rm_duplicatebooldrop repeated ratios (default true)

sdm.buffer_folds#

Buffered leave-one-out folds (blockCV's cv_buffer): for every presence (or record) the records farther than the size to train on and the record (with the background within the size) to test.

InputTypeWhat it is
recordsrequiredanythe records: points, or a table of coordinates
OutputTypeWhat it is
foldsanyper fold the records (0-based) to train and to test on
SettingTypeWhat it is
presencetexttheir presence column, 1 or 0 (default presence)
xtextthe table's x column
ytextthe table's y column
sizerequirednumberthe buffer's radius (metres on lon/lat records)
presence_backgroundbooltest on presences (default true)
add_backgroundbooland the background near them (default false)

sdm.checkerboard_folds#

A checkerboard of the predictors' cells aggregated by a factor (ENMeval's checkerboard1) or two (checkerboard2, four folds).

InputTypeWhat it is
recordsrequiredanythe records: points, or a table of coordinates
envrequiredanythe predictors: a map or a stack (their grid)
OutputTypeWhat it is
recordsanythe records with their fold
SettingTypeWhat it is
presencetexttheir presence column, 1 or 0 (default presence)
xtextthe table's x column
ytextthe table's y column
aggregationanythe factor (default 2), or two

sdm.clean_occurrences#

Occurrence records with suspicious coordinates flagged or dropped (landschaft's clean_occurrences, CoordinateCleaner's tests): invalid coordinates, equal longitude and latitude, 0/0, capitals, country and province centroids, the sea, towns, outside the country they claim, geographic outliers of their species, GBIF's headquarters, biodiversity institutions, duplicates and artificial hotspots. Each test takes false (skip it), true (its defaults), a number (its main option) or an object of its options. CoordinateCleaner's tables travel with Terraflux; Natural Earth's land, urban areas and countries are downloaded on first use (or connect your own).

InputTypeWhat it is
occurrencesrequiredanypoints, or a table with coordinate columns
capitals_refanycapitals in place of CoordinateCleaner's (points)
centroids_refanycentroids in place of CoordinateCleaner's (points)
institutions_refanyinstitutions in place of CoordinateCleaner's (points)
seas_refvectorthe land, in place of Natural Earth's (polygons)
urban_refvectorurban areas in place of Natural Earth's
countries_refvectorcountries in place of Natural Earth's
OutputTypeWhat it is
occurrencesanythe records that pass every test, or (flag) all with flag_ and flagged
countstablethe records each test flagged, and in total
SettingTypeWhat it is
xtextthe table's x column (default x, lon, longitude...)
ytextthe table's y column (default y, lat, latitude...)
speciestextthe column of the species (default species, scientificName or label)
actiontextdrop (default) or flag the suspicious records
equalanyequal longitude and latitude (default true)
zerosanyat 0/0: buffer, degrees around 0/0 (default 0.5)
capitalsanyat a country's capital: buffer (metres, default 10000), geod (true), verify (false)
centroidsanyat a country's or province's centroid: buffer (metres, default 1000), detail (both, country or provinces), geod (true), verify (false)
seasanyin the sea: scale of Natural Earth's land (110, 50 or 10; default 50)
urbananyin Natural Earth's urban areas (default false)
countriesanyoutside the country it claims: column (the records' ISO codes; a text sets it), ref_col (default iso_a2_eh for two-letter codes, else iso_a3_eh); default false
outliersanyfar from the records of its species: method (quantile, mad or distance), mltpl (5), tdi (km, 1000), size (7), min_occs (7), thinning (false), thinning_res (0.5)
gbifanyat GBIF's headquarters: buffer (metres, default 1000), geod (true), verify (false)
institutionsanyat a biodiversity institution: buffer (metres, default 100), geod (false), verify (false), verify_mltpl (10)
duplicatesanyduplicated: additions, more columns that must be equal too (default false)
aohianyat an artificial hotspot: buffer (metres, default 10000), geod (true), taxa (Aves, Insecta, Mammalia, Plantae); default false

sdm.dataset#

The records of a species distribution model (landschaft's dataset): presences (or a table with a y, presence or pa column of 1 and 0) and background points with the predictors' values at their cells, those without a value in some predictor left out.

InputTypeWhat it is
presencesrequiredanythe presences: points or a table of coordinates
backgroundanythe background points (sdm.background)
envrequiredanythe predictors: a stack (by name) or a map
OutputTypeWhat it is
recordstablex, y, presence and the predictors
SettingTypeWhat it is
xtextthe table's x column (default x, lon, longitude...)
ytextthe table's y column (default y, lat, latitude...)

sdm.download_gbif#

Occurrence records of a species from GBIF (landschaft's download_gbif, the occurrence search API, no account needed): the records with coordinates, up to 100 000 per query (narrow it by country, area or years), as points with their Darwin Core terms and GBIF's issues. For larger queries, and the DOI to cite, request a download on gbif.org.

InputTypeWhat it is
areavectoronly the records in its bounding box
OutputTypeWhat it is
occurrencesvectorthe records, points in lon/lat
queryanythe query, the taxon matched, the count and whether truncated
SettingTypeWhat it is
speciesrequiredanya scientific name (GBIF's backbone) or a taxon key
countryanyISO 3166-1 alpha-2 codes (BR), one or a list
yearanya year, or a range [1990, 2020] or "1990,2020"
basis_of_recordanyPRESERVED_SPECIMEN, HUMAN_OBSERVATION..., one or a list
max_uncertaintynumberdrop records less precise than this (metres)
limitintegerat most this many records (default all, 100 000)
has_geospatial_issueboolkeep the records GBIF flags with geospatial issues (default false)
workersintegerthe pages asked at the same time (default 4)

sdm.evaluate#

How well predictions separate presences from the background (landschaft's evaluate, dismo's): AUC, the point-biserial correlation and its p-value, the prevalence, the largest TSS and the Boyce index; the confusion table at every threshold (kappa, sensitivity, specificity, TSS...) and the thresholds that optimize them (max_kappa, max_spec_sens, no_omission, equal_prevalence, equal_sens_spec, mtp, p10).

InputTypeWhat it is
presencesrequiredanythe predictions at the presences
backgroundrequiredanyat the background points (or absences)
OutputTypeWhat it is
statstableauc, cor, pcor, np, na, prevalence, max_tss, boyce
tabletablethe confusion table per threshold
thresholdstablethe optimal thresholds
boycetableBoyce's classes: f_ratio, hs, used
SettingTypeWhat it is
columntextthe tables' column of the predictions (default the first)
thresholdsanythe thresholds of the table (default dismo's)

sdm.exdet#

Mesgaran's extrapolation detection (landschaft's exdet): NT1, below 0 where a predictor falls outside the reference's range, and inside the ranges NT2, the Mahalanobis distance against the reference's largest (above 1 a novel combination); mic, the most influential covariate, by its 1-based place among the predictors (0: no novelty).

InputTypeWhat it is
referencerequiredanythe conditions the model knows: a table of the predictors (e.g. its presences and background) or a stack
envrequiredanythe new conditions: a stack of the predictors (by name), or a table
OutputTypeWhat it is
resultanya stack on the new conditions' grid, or a table

sdm.fit#

A species distribution model with cross-validation (landschaft's fit): MaxNet (the default), a GLM (scikit-learn's StandardScaler and LogisticRegression) or a random forest (scikit-learn's RandomForestClassifier, the same trees); one fit per fold of the records (AUC of the training and test records and their difference, the largest TSS, Boyce's index, the omission rates at the minimum and 10th percentile training presence), their means and standard deviations, the records' out-of-fold predictions (for models stacked on them), and the model on every record with its threshold of maximum sensitivity plus specificity.

InputTypeWhat it is
recordsrequiredanythe records: predictors, presence (1 or 0) and fold columns
OutputTypeWhat it is
modelsdm_modelthe model on every record
metricstableper fold: fold, auc_train, auc_test, auc_diff, tss, boyce, or_mtp, or_10p, n_test
summarytablethe metrics' means and standard deviations
thresholdnumberthe threshold of maximum sensitivity plus specificity
predictionsanywith cross-validation, the records with a column prediction: the suitability from the model fitted without the record's fold (none in fold 0), to score the model on what it did not see or to feed a model stacked on it (an ensemble, a calibration, the distance to an expert range: Merow et al. 2017)
SettingTypeWhat it is
predictorsanythe predictor columns (default every other column)
presencetextthe presence column (default presence)
foldtextthe fold column (default fold)
categoricalanythe predictors that are categories (classes)
classestextthe feature classes: default (maxnet's, by each fit's presences: l, lq, lqh or lqph; with cross-validation a fold's model may get fewer than the final one: give the letters to fix them), or letters of l, q, p, h, t
regmultnumberthe regularisation multiplier (default 1)
add_samples_to_backgroundbooladd the presences to the background (true)
typetextthe output: cloglog (default), logistic
clampboolclamp to the training ranges (default true)
cvboolcross-validate over the folds (default true)
modeltextmaxnet (default), glm or random_forest
Cnumberglm: the inverse of the L2 penalty (default 1)
standardizeboolglm: standardize the predictors first (default true)
n_estimatorsintegerrandom_forest: the trees (default 100)
min_samples_leafintegerrandom_forest: default 1
min_samples_splitintegerrandom_forest: default 2
max_depthintegerrandom_forest: default none
max_featuresanyrandom_forest: the features tried per split: sqrt (default), log2, all, a number or a share
bootstrapboolrandom_forest: default true
random_stateintegerrandom_forest: scikit-learn's seed (default 1)
weightstextthe records' weights for the GLM and the forest: balanced (default: presences 1, the background their number over its), equal; a weight column of the records is taken as it is

sdm.importance#

The permutation importance of a model's predictors (landschaft's importance): the mean drop of AUC over the records when each predictor is shuffled (numpy's generator), and its standard deviation; the most important first.

InputTypeWhat it is
modelrequiredsdm_modela fitted model
recordsrequiredanythe records: predictors, presence (1 or 0) and fold columns
OutputTypeWhat it is
importancetableimportance and sd per predictor, the most important first
predictorsanythe predictors, most important first
SettingTypeWhat it is
predictorsanythe predictor columns (default every other column)
presencetextthe presence column (default presence)
foldtextthe fold column (default fold)
n_repeatsintegerthe shuffles per predictor (default 5)
seedintegernumpy's seed (default 1)

sdm.jackknife_folds#

Jackknife folds (ENMeval's): every presence its own fold; background 0.

InputTypeWhat it is
recordsrequiredanythe records: points, or a table of coordinates
OutputTypeWhat it is
recordsanythe records with their fold
SettingTypeWhat it is
presencetexttheir presence column, 1 or 0 (default presence)
xtextthe table's x column
ytextthe table's y column

sdm.maxnet#

A MaxNet species distribution model (landschaft's MaxNet, the maxnet package): Maxent as a lasso logistic regression of presences against background points over linear, quadratic, product, hinge, threshold and categorical features of the predictors (glmnet's path, maxnet's regularisation).

InputTypeWhat it is
datatablethe predictors and a presence column (1 presence, 0 background)
presencestableor the predictors at the presences
backgroundtableand at the background points
OutputTypeWhat it is
modelsdm_modelthe fitted model
coefficientsanyevery feature with a nonzero coefficient and its coefficient
SettingTypeWhat it is
presencetextthe presence column of data (default presence)
categoricalanythe predictors that are categories (classes)
classestextthe feature classes: default, or letters of l, q, p, h, t
regmultnumberthe regularisation multiplier (default 1)
add_samples_to_backgroundbooladd the presences to the background (default true)
typetextthe predictions' output: cloglog (default), logistic, exponential or link
clampboolclamp the predictors to the training ranges (default true)

sdm.maxnet_predict#

A model's predictions (maxnet's predict, the others' predict_proba): the suitability of every cell of a stack of the predictors (by name), or of every row of a table; for a MaxNet cloglog, logistic, exponential or the link, for a GLM or a forest the probability of presence.

InputTypeWhat it is
modelrequiredsdm_modela fitted model (sdm.maxnet, sdm.fit)
envrequiredanya stack of the predictors (by name), or a table
OutputTypeWhat it is
predictionanya map on the stack's grid, or a table
SettingTypeWhat it is
typetextthe output (default the model's)
clampboolclamp to the training ranges (default the model's)

sdm.mess#

Elith's multivariate environmental similarity surface (landschaft's mess, dismo's): per predictor the similarity of each value to the reference's (negative outside their range), and the least of them; negative where the model extrapolates.

InputTypeWhat it is
referencerequiredanythe conditions the model knows: a table of the predictors (e.g. its presences and background) or a stack
envrequiredanythe new conditions: a stack of the predictors (by name), or a table
OutputTypeWhat it is
resultanya stack on the new conditions' grid, or a table
SettingTypeWhat it is
fullboolevery predictor's MESS too (default false)

sdm.migrate#

A species' dispersal through the habitat suitability of successive periods (MigClim 1.6's cellular automaton, the same run for a seed): every step, a suitable empty cell is colonised from an occupied cell within the kernel's distance with the kernel's probability (times the source's propagule production while it matures, times the sink's suitability), unless barriers lie between; long-distance dispersal to random cells; cells that turn unsuitable stay until their period ends. The final map is MigClim's: 1 the initial cells, a step's number (period × 100 + step) where it colonised, 30000 suitable but not reached, below 0 lost, 0 absent.

InputTypeWhat it is
initialrequiredmapthe initial distribution: 1 present, 0 absent
suitabilityrequiredrasterthe habitat suitability of each period, 0 to 1000 (a stack, a loop's series, rasters)
barriersmapthe barriers (1)
OutputTypeWhat it is
mapmapthe final state (MigClim's codes)
occupiedmap1 where the species is at the end, 0 elsewhere
stepsstackthe state after every dispersal step
tabletableper step: period, step, step_id, unlimited, no_dispersal, occupied, absent, colonized, decolonized, ldd
SettingTypeWhat it is
stepsintegerdispersal steps per period (default 1)
kernelrequiredanythe probability of colonisation at 1, 2... cells: [1, 0.4, 0.1]
ini_maturityintegerthe age a cell first disperses (default 1)
full_maturityintegerthe age it fully disperses (default 1)
propagulesanythe propagule production of the ages from ini_maturity to full_maturity (default 1 each)
thresholdintegersuitability below it 0, else 1000 (default 0: none)
ldd_frequencynumberlong-distance dispersal's frequency (default 0)
ldd_minintegerits smallest distance in cells (default 10)
ldd_maxintegerits largest distance in cells (default 15)
barrier_typetextstrong (default: two of five lines) or weak (all five)
seedintegerthe seed of the C runtime's rand() (default 1)

sdm.mop#

The mobility-oriented parity of new conditions (landschaft's mop, the mop package): the mean distance of each to its nearest reference conditions (Euclidean or Mahalanobis), and where the predictors fall outside the reference's ranges (basic; simple: how many; detailed: which, below and above, as sums of 2^k).

InputTypeWhat it is
referencerequiredanythe conditions the model knows: a table of the predictors (e.g. its presences and background) or a stack
envrequiredanythe new conditions: a stack of the predictors (by name), or a table
OutputTypeWhat it is
resultanya stack on the new conditions' grid, or a table
SettingTypeWhat it is
typetextbasic (default), simple or detailed
distancetexteuclidean (default), mahalanobis or none
wheretextthe conditions whose distance to take: in_range (default), out_range or all
percentagenumberthe share of the reference nearest, (0, 100] (default 1)
scaleboolscale the predictors (Euclidean; default false)
centerboolcenter them (Euclidean; default false)
rescaleboolthe distances rescaled to 0-1 (default false)

sdm.omission_rate#

The share of test presences predicted below the training presences' minimum (mtp) or 10th percentile (p10, default) (landschaft's omission_rate, ENMeval's).

InputTypeWhat it is
trainrequiredanythe predictions at the training presences
testrequiredanyat the test presences
OutputTypeWhat it is
ratenumberthe omission rate
SettingTypeWhat it is
columntextthe tables' column of the predictions (default the first)
thresholdtextp10 (default) or mtp

sdm.one_per_cell#

A record per cell of a raster (landschaft's one_per_cell): the first in each cell, those outside the raster left out (and with drop_missing those on cells without a value in any layer).

InputTypeWhat it is
occurrencesrequiredanypoints, or a table with coordinate columns
rasterrequiredanya map or a stack: its grid
OutputTypeWhat it is
occurrencesanythe records kept
SettingTypeWhat it is
xtextthe table's x column (default x, lon, longitude...)
ytextthe table's y column (default y, lat, latitude...)
drop_missingbooldrop records on cells without values (default false)

sdm.prepare#

The preparation of a species distribution model in one node (landschaft's prepare): the records cleaned (CoordinateCleaner's tests), one per cell, thinned; the accessible area; the predictors without collinearity in it; background points in it; the predictors' values at the records; the folds. Each step takes false (skip it), true, a number (its main setting) or an object of the settings of its node; one seed for every random step. The report counts what each step removed.

InputTypeWhat it is
occurrencesrequiredanythe records: points, or a table with coordinate columns
envrequiredanythe predictors: a stack (by name) or a map
areavectorthe accessible area, in place of the area step
backgroundanybackground points, in place of the background step
regionsvectorregions for the area step (method regions)
withinvectorpolygons the area is cut to
OutputTypeWhat it is
recordstablex, y, presence, the predictors and the fold
envanythe predictors kept
areavectorthe accessible area (else the predictors' extent)
presencesanythe records left
background_pointsanythe background points
reportanyper step: the presences, those removed and why
settingsanyevery setting used
SettingTypeWhat it is
xtextthe table's x column (default x, lon, longitude...)
ytextthe table's y column (default y, lat, latitude...)
speciestextkeep only this species (the species column)
cleananysdm.clean_occurrences' settings (default true)
one_per_cellboola record per cell of the predictors (default true)
thinanysdm.thin: the distance in metres or its settings (off)
areaanysdm.accessible_area: the buffer's distance in metres or its settings (off: the whole extent)
predictorsanysdm.select_predictors: the VIF threshold (10) or settings
backgroundanysdm.background: the points (10000) or settings
foldsanyk spatial blocks (5), or {method: blocks, quadrants, checkerboard, random, jackknife or clusters, and its settings}; blocks take size "auto" (the predictors' range of autocorrelation)
seedintegerthe seed of every random step (default 1)

sdm.quadrant_folds#

The four quadrants of the presences (ENMeval's block partition): near-equal counts split along the orientation's axes, the background by the same lines.

InputTypeWhat it is
recordsrequiredanythe records: points, or a table of coordinates
OutputTypeWhat it is
recordsanythe records with their fold
SettingTypeWhat it is
presencetexttheir presence column, 1 or 0 (default presence)
xtextthe table's x column
ytextthe table's y column
orientationtextlat_lon (default), lon_lat, lon_lon or lat_lat

sdm.random_folds#

Random folds of the presences (landschaft's random_folds, ENMeval's randomkfold): k groups of near-equal size drawn with R's generator; background 0.

InputTypeWhat it is
recordsrequiredanythe records: points, or a table of coordinates
OutputTypeWhat it is
recordsanythe records with their fold
SettingTypeWhat it is
presencetexttheir presence column, 1 or 0 (default presence)
xtextthe table's x column
ytextthe table's y column
kintegerthe folds (default 5)
seedintegerthe seed of R's generator (default 1)

sdm.reference_data#

The geographic reference data of the cleaning of records (landschaft's reference_data): CoordinateCleaner's centroids and capitals of countries and provinces (countryref, at the centroids), biodiversity institutions and artificial hotspots (aohi), and Natural Earth's land (land110, land50, land10), urban areas (urban50) and countries (countries50), downloaded on first use.

OutputTypeWhat it is
featuresvectorthe points or polygons, with their attributes
SettingTypeWhat it is
namerequiredtextthe data set

sdm.response_curves#

A model's response curves (landschaft's response_curves): each predictor over its range in the records, the others at their mean or median; a column of values and one of suitability per predictor.

InputTypeWhat it is
modelrequiredsdm_modela fitted model
recordsrequiredanythe records: predictors, presence (1 or 0) and fold columns
OutputTypeWhat it is
curvestable and _suitability columns
SettingTypeWhat it is
predictorsanythe predictor columns (default every other column)
presencetextthe presence column (default presence)
foldtextthe fold column (default fold)
ofanythe predictors to draw (default all)
nintegerthe steps (default 100)
fixedtextthe others at their mean (default) or median

sdm.select_predictors#

Predictors without collinearity (landschaft's select_predictors, usdm's vifcor and vifstep): the most correlated pairs above a correlation dropped one by one (the one of larger VIF), then the predictors of the largest VIF above a threshold; those to keep stay.

InputTypeWhat it is
envrequiredanythe predictors: a stack (by name) or a table
areavectorthe area of the stack to look at
OutputTypeWhat it is
envanythe predictors kept: a stack or a table
selectionanykept, excluded (in order) and the kept ones' VIF
SettingTypeWhat it is
sizeintegerthe cells sampled on large grids (default 5000; null: all)
seedintegerthe seed of R's generator (default 1)
vifnumberthe VIF threshold (default 10; null: none)
cornumberthe correlation threshold (default none)
keepanythe predictors to keep
methodtextof the correlation: pearson (default), spearman, kendall

sdm.spatial_blocks#

Spatial blocks (blockCV's cv_spatial): the records in hexagons or squares of a size (or rows and columns), the blocks assigned to k folds at random (the most balanced of the iterations), systematically or as a checkerboard.

InputTypeWhat it is
recordsrequiredanythe records: points, or a table of coordinates
OutputTypeWhat it is
recordsanythe records with their fold
SettingTypeWhat it is
presencetexttheir presence column, 1 or 0 (default presence)
xtextthe table's x column
ytextthe table's y column
sizenumberthe blocks' size (metres on lon/lat records)
rows_colsanyelse their rows and columns (default [10, 10])
kintegerthe folds (default 5)
hexagonboolhexagons (default) or squares
flat_topboolflat-topped hexagons (default false)
selectiontextrandom (default), systematic or checkerboard
iterationintegerthe random assignments tried (default 100)
offsetanythe blocks' offset, [x, y] shares of a block
extendnumbersquares: the extent grown by this percentage
deg_to_metrenumbermetres per degree on lon/lat (111325)
seedintegerthe seed of R's generator (default 1)

sdm.spatial_clusters#

Spatial or environmental clusters (blockCV's cv_cluster): R's kmeans of the records' coordinates, or of the predictors at the records (scaled as terra).

InputTypeWhat it is
recordsrequiredanythe records: points, or a table of coordinates
envanythe predictors: environmental clusters
OutputTypeWhat it is
recordsanythe records with their fold
SettingTypeWhat it is
presencetexttheir presence column, 1 or 0 (default presence)
xtextthe table's x column
ytextthe table's y column
kintegerthe clusters (default 5)
scaleboolscale the predictors (default true)
algorithmtextHartigan-Wong (default), Lloyd, Forgy or MacQueen
seedintegerthe seed of R's generator (default 1)

sdm.thin#

Occurrence records thinned (landschaft's thin, spThin's thin.algorithm): records dropped at random until none is closer than the distance to another (great-circle, on lon/lat), the repetition that keeps the most.

InputTypeWhat it is
occurrencesrequiredanypoints, or a table with coordinate columns
OutputTypeWhat it is
occurrencesanythe records kept
keptanyhow many each repetition kept, most first
SettingTypeWhat it is
xtextthe table's x column (default x, lon, longitude...)
ytextthe table's y column (default y, lat, latitude...)
distancerequirednumberthe least distance between records, in metres
repsintegerthe repetitions (default 10)
seedintegerthe seed of R's generator (default 1)

sdm.threshold#

A threshold of suitability from presences and background (landschaft's threshold, dismo's): max_spec_sens (default), max_kappa, no_omission, equal_prevalence, equal_sens_spec, mtp, p10, or the highest that keeps a sensitivity.

InputTypeWhat it is
presencesrequiredanythe predictions at the presences
backgroundrequiredanyat the background points
OutputTypeWhat it is
thresholdnumberthe threshold
SettingTypeWhat it is
columntextthe tables' column of the predictions (default the first)
methodtextthe criterion (default max_spec_sens)
sensitivitynumberof the method sensitivity (default 0.9)

sdm.vif#

The variance inflation factor of every predictor (landschaft's vif, usdm's vif): 1 / (1 - R^2) of its regression on the others (R's lm), over the cells of the stack (a sample of them on large grids) or the rows of a table.

InputTypeWhat it is
envrequiredanythe predictors: a stack (by name) or a table
areavectorthe area of the stack to look at
OutputTypeWhat it is
viftablea column per predictor, its VIF
SettingTypeWhat it is
sizeintegerthe cells sampled on large grids (default 5000; null: all)
seedintegerthe seed of R's generator (default 1)