Learn R Programming

treescape (version 1.8.16)

plotGrovesD3: Scatterplot of groups of trees using scatterD3

Description

This function displays the scatterplot of the Multidimensional Scaling (MDS) output by treescape, superimposing group information (derived by findGroves) using colors. scatterD3 enables interactive plotting based on d3.js, including zooming, panning and fading effects in the legend.

Usage

plotGrovesD3(x, groups = NULL, xax = 1, yax = 2, treeNames = NULL,
  symbol_var = NULL, xlab = paste0("Axis ", xax), ylab = paste0("Axis ",
  yax), ...)

Arguments

Value

A scatterD3 plot

See Also

findGroves to find any clusters in the tree landscape

Examples

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

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

## basic plot
plotGrovesD3(res)

## adding tree labels
plotGrovesD3(res, treeNames=1:201)

## customizing: vary the colour and the symbol by group
plotGrovesD3(res, symbol_var=res$groups)

## example with no group information
plotGrovesD3(res$treescape$pco)
}

Run the code above in your browser using DataLab