My Sankey plot

my_sankey(
  test,
  mode = c("sankeyD3", "ggsankey"),
  topN = "all",
  space = 1,
  width = 0.1,
  str_width = 20,
  notshow = c(),
  D3_params = NULL,
  ...
)

Arguments

test

a dataframe with hierarchical structure

mode

"sankeyD3","ggsankey"

topN

"all" or numeric vector, determine how many topN shows in each column

space

space width for ggsankey

width

width

str_width

str_width

notshow

notshow

D3_params

look for parameters in sankeyNetwork

...

additional parameters

Value

ggplot or htmlwidget

Examples

# \donttest{
if (interactive()) {
  data.frame(
    a = c("a", "a", "b", "b", "c"),
    aa = rep("a", 5),
    b = c("a", LETTERS[2:5]),
    c = 1:5
  ) %>%
    my_sankey(., "gg", num = TRUE)
  data(otutab)
  cbind(taxonomy, num = rowSums(otutab))[1:10, ] -> test
  my_sankey(test)
}
# }