plotGrovesD3: Scatterplot of groups of trees using 'scatterD3'

Description Usage Arguments Value Author(s) See Also Examples

View source: R/plotGroves.R

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

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

Arguments

x

a list returned by findGroves or a MDS with class dudi

groups

a factor defining groups of trees. If x is a list returned by findGroves these will be detected automatically.

xax

a number indicating which principal component to be used as 'x' axis

yax

a number indicating which principal component to be used as 'y' axis

treeNames

if a list of tree names or labels are given, these will be plotted alongside the points. Their size can be altered using labels_size - see ?scatterD3 for more information.

symbol_var

a factor by which to vary the symbols in the plot

xlab

the label for the 'x' axis. Defaults to use the value of 'xax'

ylab

the label for the 'y' axis. Defaults to use the value of 'yax'

...

further arguments passed to scatterD3

Value

A scatterD3 plot

Author(s)

Thibaut Jombart thibautjombart@gmail.com

See Also

findGroves to find any clusters in the tree landscape

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
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)
}

## End(Not run)

treescape documentation built on May 19, 2017, 3:32 p.m.