Description Usage Arguments Value Examples
Plots a Sankey diagram
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
nodes |
data.frame, containing the nodes definition |
flows |
data.frame, containing the nodes definition |
palette |
data.frame, containing the nodes definition |
node_style |
list: containing node style specifiers:
|
title |
character: plot title. use |
legend |
logical or gpar: Specifies the plotting of a legend. valid values are NULL (default; no legend), TRUE (plot a legend using standard text size and color), or the output of a call to gpar(), to control legend text size and color. |
page_margin |
numeric: Page margin. Either a scalar, an (x,y) vector or an (left,bot,rt,top) vector |
max_width |
numeric: Maximum width of the flow bundles, in fraction of the plot size |
rmin |
numeric: Minimum radius for flow path bends (as fraction of the diagram's units) |
copyright |
character: optional copyright statement? |
grill |
logical: Plot a coordinate grill? |
verbose |
logical: print some diagnostic messages? |
The modified nodes data.frame
1 2 3 4 5 6 7 8 9 | nodes <- data.frame(ID=c("A","B"), x=1:2, y=0)
flows <- data.frame(from="A", to="B", quantity=10, substance="stuff")
sankey(nodes, flows)
colors <- data.frame(substance="stuff", color="blue")
sankey(nodes, flows, colors)
sankey(nodes, flows, legend=TRUE) # Plots default legend
sankey(nodes, flows, legend=grid::gpar(fontsize=18, ncols=2)) # Large fonts; 2 columns
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.