plotsankey: Plot a sankey diagram, using the D3 library networkD3

Description Usage Arguments Examples

View source: R/D3.R

Description

Plot a sankey diagram, using the D3 library networkD3

Usage

1
plotsankey(linksandnodes, value = "tradevalue", units = "K€")

Arguments

linksandnodes

a list containing 2 dataframes: links and nodes

value

the value to be displayed in the sankey diagram, a column in linksandnodes$links

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
con <- RMariaDB::dbConnect(RMariaDB::MariaDB(), dbname = "tradeflows")
wood <- tbl(con, "vld_comext_monthly") %>% 
   filter(productcode ==  44072199 & 
              flowcode == 1 & 
              period == "201708") %>% 
   # head(200) %>% 
   collect()
reporter <- tbl(con, "vld_comext_reporter") %>% collect()
partner <- tbl(con, "vld_comext_partner") %>% collect()
wood %>% 
    preparesankeynodes %>% 
    plotsankey()

## End(Not run)

stix-global/eutradeflows documentation built on Nov. 13, 2020, 9:23 p.m.