1

I am a complete novice when it comes to using R and need some help. I have successfully made a sankey diagram in R but now want to make it into an accessible html. I have seen my professor do this but when I attempt to replicate it with the sankeyPlot$setTemplate function I lose the sankey diagram and no link. Below is what I have so far that allows the sankey to appear.

MSTsankey <- read_csv("C:Users/ammar/Desktop/Source Target Value 2.csv")
# require(rCharts)
sankeyPlot <- rCharts$new()
sankeyPlot$setLib('http://timelyportfolio.github.io/rCharts_d3_sankey')

workingdata <- MSTsankey
colnames(workingdata) <- c('source','target','value')
sankeyPlot$set(
  data = workingdata,
  nodeWidth = 15,
  nodePadding = 10,
  layout = 32,
  width = 1000
  height = 500
)
sankeyPlot

1 Answers1

1

You need to save the plot.

sankeyPlot$save('mychart.html', standalone = TRUE)

Where sankeyPlot is the plot variable and mychart is the filename you wish to save.

Karthik Arumugham
  • 1,300
  • 1
  • 11
  • 18