drawSankey: drawSankey

Description Usage Arguments Value Examples

View source: R/functions.R

Description

Create an HTML document that can be viewed and saved to file. Diagram properties can be modified in this function, makeSankey() and initSankey().

Usage

1
2
3
drawSankey(List, height = NULL, legendfont = "sans-serif",
  legendsize = 12, width = 1000, caption = "Sankey figure",
  nodeValue = "node values", pathValue = "path values", directory = NULL)

Arguments

List

Data frame containing 6 columns: source, target, description, value, sourcefc, targetfc.

height

Pixel height of the figure to draw. If empty, the figure will be given a pixel height proportional to the number of rows in List up to a maximum 1800px or minimum of 300px. These can be overridden by defining this parameter.

legendfont

Font of the legend text.

legendsize

Font size of the legend text.

width

Pixel width of the figure to draw. By default, 1000px.

caption

Sankey figure caption. HTML formatting is possible.

nodeValue

Description of node scale in legend.

pathValue

Description of path scale in legend.

directory

Absolute path to output directory. If null, the working directory obtained from getwd() will be used. This is required if D3 and sankey JS files were downloaded with initSankey().

Value

HTML document containing diagram.

Examples

1
2
3
4
5
6
7
8
Level1 <- createList(poorprog$Level1)
Level2 <- createList(poorprog$Level2)
tempList <- append2List(Level1,Level2)
initSankey()
tempList2 <- makeSankey(tempList, averagePath=TRUE)
sankey <- drawSankey(tempList2)
library(htmltools) # can also be launched with
html_print(sankey)

kzouchka/Director documentation built on Oct. 10, 2020, 5:29 p.m.