make_sankey | R Documentation |
A Sankey diagram is a flow diagram in which the width of the lines is proportional to the rate of energy flow. Sankey diagrams are a helpful way to visualize energy flows in an energy conversion chain (ECC). This function takes a matrix description of an ECC and produces a Sankey diagram.
make_sankey(
.sutmats = NULL,
R = Recca::psut_cols$R,
U = Recca::psut_cols$U,
V = Recca::psut_cols$V,
Y = Recca::psut_cols$Y,
simplify_edges = TRUE,
sankey = Recca::sankey_cols$sankey,
...
)
.sutmats |
an optional wide-by-matrices data frame |
R, U, V, Y |
See |
simplify_edges |
a boolean which tells whether edges should be simplified.
Applies to every row of |
sankey |
See |
... |
Arguments passed to |
At present, this function uses the networkD3
package to draw the Sankey diagram.
If any of R
, U
, V
, or Y
is NA
, NA
is returned.
a Sankey diagram
library(dplyr)
library(magrittr)
library(networkD3)
library(tidyr)
UKEnergy2000mats %>%
spread(key = "matrix.name", value = "matrix") %>%
make_sankey() %>%
extract2("Sankey") %>%
extract2(1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.