Learn R Programming

treescape (version 1.0.0)

findGroves: Identify clusters of similar trees

Description

This function uses hierarchical clustering on principal components output by treescape to identify groups of similar trees. Clustering relies on hclust, using Ward's method by default.

Usage

findGroves(x, method = treeVec, nf = NULL, clustering = "ward.D2",
  nclust = NULL, ...)

Arguments

Value

A list containing:
  • groups: a factor defining groups of trees
  • treescape: the output of treescape

See Also

plotGroves to display results

Examples

Run this code
if(require("adegenet") && require("adegraphics")){
## load data
data(woodmiceTrees)

## run findGroves: treescape+clustering
res <- findGroves(woodmiceTrees, nf=5, nclust=6)

## plot results on first 2 axes
PCs <- res$treescape$pco$li
s.class(PCs, fac=res$groups, col=funky(6))

## using plotGroves
plotGroves(res)
}

Run the code above in your browser using DataLab