R/adaptive_index.R
adaptive_index.RdThe adaptive_index function allows the user to estimate the optimal
adaptive genetic component for any combination of environmental conditions, and project it
onto the landscape.
adaptive_index(RDA, K, env, env_mask = NULL, method = "loadings")
# S4 method for class 'rda,ANY,SpatRaster,ANY'
adaptive_index(RDA, K, env, env_mask = NULL, method = "loadings")
# S4 method for class 'rda,ANY,data.frame,missing'
adaptive_index(RDA, K, env, method = "loadings")a RDA model from which to extract loci and environmental variable scores
an integer specifying the number of RDA axes to use for the projection
a RasterStack object or a data.frame with the environmental
conditions of the sites to predict
(optional, default NULL)
a Raster object to
limit the projection to a specific area
(default 'loadings')
a character defining whether
the function is to use weighted averages (scaling type 1, loadings) or linear
combinations (scaling type 2, predict) of the projected environmental variables
to predict site scores (i.e., adaptive index)
A RasterStack object or a data.frame containing the projections for the
K first RDA axes
The adaptive index provides an estimate of adaptive genetic similarity or difference of all pixels on the landscape as a function of the values of the environmental predictors at that location. When projected on a map, it allows visualizing the different adaptive gradients across a species range.