drawSankey {Director} | R Documentation |
Create an HTML document that can be viewed and saved to file. Diagram properties can be modified in this function, makeSankey() and initSankey().
drawSankey(List, height = NULL, legendfont = "sans-serif", legendsize = 12, width = 1000, caption = "Sankey figure", nodeValue = "node values", pathValue = "path values", directory = NULL)
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(). |
HTML document containing diagram.
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)