
Project current environmental clusters onto a future climate scenario
Source:R/PredictiveProvenance.R
projectClusters.RdMain entry point for the future-projection workflow. The steps are:
Usage
projectClusters(
eSDM_object,
current_clusters,
future_predictors,
current_predictors,
planar_proj,
coord_wt = 0.001,
mess_threshold = 0,
cluster_novel = TRUE,
n_novel_pts = 500,
n_sample_per_cluster = 50,
nbclust_args = list(),
thresh_metric = "sensitivity",
thresholds
)Arguments
- eSDM_object
output from
elasticSDM().- current_clusters
Output list from
EnvironmentalBasedSample().- future_predictors
SpatRaster of future climate. Layer names must match those retained in
current_model.- current_predictors
SpatRaster of current climate (used for MESS reference and for
rescaleFuturestandardisation).- planar_proj
EPSG code or proj4 string for a planar projection in metres (same as used in the current analysis).
- coord_wt
Numeric, default
0.001. Coordinate weighting passed toadd_weighted_coordinates.- mess_threshold
MESS values below this are treated as novel climate. Default
0.- cluster_novel
Boolean, defualt
TRUE. IfTRUEand novel cells exist, cluster them independently with NbClust. IfFALSEnovel cells are left asNA.- n_novel_pts
Numeric, default 500. Number of points to sample from novel areas for clustering.
- n_sample_per_cluster
Number of points to sample from each cluster (existing and novel) for the relationship tree. Default
50.- nbclust_args
Named list of arguments forwarded to
NbClust::NbClust. Sensible defaults are set internally (min.nc = 2,max.nc = 10,method = "ward.D2",index = "all").- thresh_metric
Character. Default 'sensitivity', dismo::threshold to use for cutting the future sdm into a binary surface.
- thresholds
current era thresholds from
postProcessSDM
Value
A named list:
- clusters_sf
sfpolygons with columnID.- suitable_habitat
Raster of masked suitable habitat under future conditions
- novel_mask
SpatRaster— logical,TRUEwhere MESS < threshold.- mess
SpatRaster— raw MESS scores (minimum across all variables).- changes
data.frame— per-cluster area and centroid-shift metrics.- novel_similarity
data.frame— nearest existing cluster and mean silhouette width for each novel cluster. Zero-row data frame if none.
Details
Rescale future predictors with current betas (
rescaleFuture).Run
dismo::messto identify novel climate cells.Predict known-climate cells with the existing KNN classifier.
If novel cells exist and
cluster_novel = TRUE, cluster them independently withNbClust(cluster_novel_areas).Sample points from every cluster (existing + novel), force them onto a single tree, and extract nearest-existing-cluster relationships via silhouette (
analyze_cluster_relationships).Polygonise and calculate area / centroid changes.