The adaptive_groups
function allows the user to find groups of covarying
individuals/populations based on their scores in the RDA space and a hkmean clustering procedure.
adaptive_groups
accommodates stack of rasters or discrete populations.
adaptive_groups(RDA, K, env, nb_clusters)
# S4 method for class 'rda,ANY,missing'
adaptive_groups(RDA, K, nb_clusters)
# S4 method for class 'rda,ANY,SpatRaster'
adaptive_groups(RDA, K, env, nb_clusters)
a RDA model from which to extract loci and environmental variable scores
an integer specifying the number of RDA axes to use for the clustering
a stack of rasters or a data.frame with the environmental conditions of the sites to predict
an integer specifying the number of cluster to identify
A list
containing :
samples
: a data.frame
with the cluster associated with each individual/population
polygons
: polygon coordinates to outline the different cluster on a 2D RDA space
Identify a discrete number of adaptive groups across the 2D RDA space. Next version will use more than two dimensions