e_sankey: Sankey

View source: R/add.R

e_sankeyR Documentation

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 or a proxy as returned by echarts4rProxy.

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

Additional arguments

Examples

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)

echarts4r documentation built on July 9, 2023, 7:26 p.m.