Dendro network
The Dendro network is a network visualization that uses a hierarchical type of visualization of data. It is particularly useful when visualizing `hierarchical clustering or tree structures. It contains the root node where the tree graph starts and the parent node where the tree graph ends. It can help for understanding complex information through network visualization.
Syntax:
dendroNetwork(hc, height=500, width=800, fontSize=10, linkColour=”#ccc”,nodeColour=”#fff”, nodeStroke=”steelblue”, textColour=”#111″, textOpacity=0.9,textRotate=NULL, opacity=0.9, margins=NULL, linkType=c(“elbow”, “diagonal”), treeOrientation=c(“horizontal”, “vertical”), zoom=FALSE)
Arguments:
- hc – A hierarchical (hclust) cluster object.
- height – The numeric height for the network graph’s frame area in pixels.
- width – The numeric width for the network graph’s frame area in pixels.
- fontSize – The numeric font size in pixels for the node text labels.
- linkColour – A character string specifying the colour you want the link lines to be.
- nodeColour – A character string specifying the colour you want the node circles to be.
- nodeStroke – A character string specifying the color you want the node perimeter to be.
- textColour – A character string specifying the color you want the text to be before they are clicked.
- textOpacity – The numeric vector or scalar of the proportion opaque you would like the text to be before they are clicked.
- textRotate – The numeric degrees to rotate text for node text. The default is 0 for horizontal and 65 degrees for vertical.
- opacity – The numeric value of the proportion opaque you would like the graph elements to be.
- margins – An integer or a named
list
/vector
of integers for the plot margins. - linkType – Character specifying the link type between points.
- treeOrientation – Character specifying the tree orientation(“vertical”,”horizontal”).
- zoom – Logical value ( ‘TRUE’ – enable, ‘FALSE’ – disable ).
Consider there is a family consisting of family members and their ancestors, If a Researcher want to collect ancient data about a family like their ancestors related details and he/she wants to visualize those data in an understandable and structured form. In this type of scenario, a Researcher can choose Dendro Network. The family members, their parents, their grandparents, their great grandparents, etc., can be represented as nodes of the network, and the relationship links between them can be represented as edges.
#Load library
library(networkD3)
#Creating data
hc <- hclust(dist(USArrests), method="ave")
#dendro_network
dendroNetwork(hc,textColour=c("red","green","orange")[cutree(hc,3)], height=600)
Output:
- Load the library using library(networkD3).
- Creating US crime data as in hierarchical cluster format.
- Create dendro network using dendroNetwork(), assign hierarchical cluster variable to hc, add textColour, cut down the tree using cutree() and assign 600 to height.
networkD3 package in R
Data-driven document Network is an R package for creating network graphs which are used for 3-dimensional visualizations of data as network graphs. In R Programming Language networkD3 plots are created using the networkD3 package.
Table of Content
- Simple Network
- Force Network
- Sankey Network
- Radial Network:
- Dendro network
- Chord Network
To use a package in R programming we have to install the package first. For installing the R package in R studio use the command install.packages(“name”). Follow the following steps to get the packages installed on your system.
install.packages('networkD3')