tab4net | R Documentation |
This function generates lists from column-oriented tables (data frames) for
Sankey Networks diagrams produced by networkD3::sankeyNetwork()
.
tab4net(formula, data, FUN, ...)
formula |
A formula passed to |
data |
A data frame with the variables included in 'formula'. |
FUN |
A function passed to |
... |
Further arguments passed to |
A list with two data frames called 'nodes' and 'links'.
require(networkD3)
## Different values of WET-Health scores for vegetation per land use
veg_wh <- tab4net(UseunitID ~ Landuse + WET_veg, WHscores, length)
sankeyNetwork(
Links = veg_wh$links, Nodes = veg_wh$nodes, Source = "source",
Target = "target", Value = "value", NodeID = "name",
units = "TWh", fontSize = 12, nodeWidth = 30
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.