The genomic_offset function allows the user to predict genomic offset
from a RDA model. The genomic_offset function can estimate both temporal or spatial
genomic offset and accommodates raster data or discrete populations.
genomic_offset(
  RDA,
  K,
  env_pres,
  env_fut,
  env_mask = NULL,
  env_gar,
  method = "loadings"
)
# S4 method for class 'rda,ANY,SpatRaster,ANY,ANY,missing'
genomic_offset(RDA, K, env_pres, env_fut, env_mask = NULL, method = "loadings")
# S4 method for class 'rda,ANY,data.frame,ANY,missing,missing'
genomic_offset(RDA, K, env_pres, env_fut, method = "loadings")
# S4 method for class 'rda,ANY,data.frame,missing,missing,ANY'
genomic_offset(RDA, K, env_pres, env_gar, 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 in the present
a RasterStack object or a data.frame with the environmental
conditions in the future
(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 list containing :
genomic_offset : a RasterStack or a data.frame containing
  the genomic offset predictions for the K first RDA axes, as well as the overall
  genomic offset prediction
weights : the weights associated with each RDA axis used for the predictions
This RDA-based method to predict genomic offset is relatively simple.
RDA is first used to predict the optimal adaptive genetic composition for each
environmental pixel under consideration (see adaptive_index function),
using both current and future environmental conditions.
The euclidean distance between these two predictions in the RDA space provides an
estimate of the change in genetic composition that would be required to track climate change.