writeSankey: writeSankey

Description Usage Arguments Value Examples

View source: R/functions.R

Description

Save sankey figure as a simple HTML file accessible outside of R and shiny. Functions initSankey, makeSankey and drawSankey must be performed before this step to ensure a proper figure is saved.

Usage

1
writeSankey(name = NULL, title = NULL, directory = NULL)

Arguments

name

Name to give file. If no path given, the working directory OR path set in Director will be used. Same name will be given as the title.

title

Title of the HTML file produced. The file name is used by default.

directory

Absolute path to output directory. If null, the working directory obtained from getwd() will be used. If no absolute path is given (i.e. no "/" is grepped), it will assume a new folder will be created in the working directory.

Value

a dynamic HTML file in the specified directory that is readable in any internet browser so long as the 'www' subfolder is included.

Examples

1
2
3
4
5
6
7
Level1 <- createList(poorprog$Level1)
Level2 <- createList(poorprog$Level2)
tempList <- append2List(Level1,Level2)
initSankey() # initializes working directory
tempList2 <- makeSankey(tempList, averagePath=TRUE) # Calculate node and path values
sankey <- drawSankey(tempList2)
writeSankey("temp") # Save figure as the file 'temp.html' in working directory.

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