D3Dendro: D3 Dendrogram

Description Usage Arguments Author(s) References Examples

View source: R/D3.R

Description

Creates a html file containing json file and a D3.js Dendrogram

Usage

1
2
D3Dendro(JSON, file_out, height = 800, width = 700,
  radial.diameter = 1600, collapsible = FALSE, radial = FALSE)

Arguments

JSON

A json object

file_out

the location and name for the output html file

height

the height of the dendrogram

width

the width of the dendrogram

radial.diameter

The diameter of your radial visualisation. Only needed (and used) when radial=TRUE

collapsible

Logical TRUE/FALSE as to whether you want the visualisation to be collapsible with a single-click on the nodes

radial

Logical TRUE/FALSE as to whether you want the dendrogram to be radial.

Author(s)

James Thomson & Andrew Patterson

References

Mike Bostock's lovely d3: http://d3js.org/ and Captain Anonymous' collapsible radial dendrogram here: http://codepen.io/anon/pen/xItvw

Examples

1
2
3
4
5
6
7
hc <- hclust(dist(USArrests), "ave")
plot(hc)
JSON<-jsonHC(hc)
D3Dendro(JSON,width=400, file_out="USArrests_Dendo.html")
D3Dendro(JSON,collapsible=TRUE,file_out="USArrests_Dendo_collapse.html")
D3Dendro(JSON,collapsible=FALSE,radial=TRUE, file_out="USArrests_Dendo_radial.html")
D3Dendro(JSON,collapsible=TRUE,radial=TRUE,file_out="USArrests_Dendo_collapse_radial.html")

jamesthomson/R2D3 documentation built on May 18, 2019, 11:21 a.m.