This R package contains a set of functions that facilitate commonly applied data preparation and exploration steps.
networkD3
hierarchical plots (see examples below).devtools::install_github('jcizel/GeneralUtilities')
require(GeneralUtilities)
dt2HList
## HIERARCHICAL PLOTS WITH `networkD3`
##
## Below I illustrate the utility of the `df2Hlist` function by recreating some
## of the examples discussed by `@timelyportfolio` in Week 3 of his `htmlwidgets`
## blog (see http://www.buildingwidgets.com/blog/).
devtools::install_github("timelyportfolio/networkD3@feature/d3.chart.layout")
require(networkD3)
l <-
df2HList(dt = mtcars,
split = c('gear','carb'),
sizeVar = 'wt')
## Add root node (necessary for some graphs)
l2 <- list(
root = 'test',
children = l
)
## Plot 1
hierNetwork(
List = l2,
type = 'tree.cartesian',
zoomable = T,
collapsible = T
)
## Plot 2
hierNetwork(
List = l2,
type = 'tree.radial',
zoomable = T,
collapsible = T
)
## The following plots also rely on the sizeArg argument
## Plot3
hierNetwork(
List = l2,
type = 'pack.nested',
zoomable = T,
collapsible = T
)
## Plot4
hierNetwork(
List = l2,
type = 'pack.nested',
zoomable = T,
collapsible = T
)
## Plot 5
hierNetwork(
List = l2,
type = 'partition.rectangle',
zoomable = T,
collapsible = T
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.