Learn R Programming

echarts4r (version 0.1.1)

e_sankey: Sankey

Description

Draw a sankey diagram.

Usage

e_sankey(e, source, target, value, layout = "none", rm.x = TRUE,
  rm.y = TRUE, ...)

e_sankey_(e, source, target, value, layout = "none", rm.x = TRUE, rm.y = TRUE, ...)

Arguments

e

An echarts4r object as returned by e_charts.

source, target

Source and target columns.

value

Value change from source to target.

layout

Layout of sankey.

rm.x, rm.y

Whether to remove the x and y axis, defaults to TRUE.

...

Any other option to pass, check See Also section.

See Also

https://ecomfe.github.io/echarts-doc/public/en/option.html#series-sankey

Examples

Run this code
# NOT RUN {
sankey <- data.frame(
  source = c("a", "b", "c", "d", "c"),
  target = c("b", "c", "d", "e", "e"),
  value = ceiling(rnorm(5, 10, 1)),
  stringsAsFactors = FALSE
)

sankey %>% 
  e_charts() %>% 
  e_sankey(source, target, value) 

# }

Run the code above in your browser using DataLab