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)

Arguments

RDA

a RDA model from which to extract loci and environmental variable scores

K

an integer specifying the number of RDA axes to use for the clustering

env

a stack of rasters or a data.frame with the environmental conditions of the sites to predict

nb_clusters

an integer specifying the number of cluster to identify

Value

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

Details

Identify a discrete number of adaptive groups across the 2D RDA space. Next version will use more than two dimensions

Author

Thibaut Capblancq