Problems while reproducing Sankey chart example with d3_sankey
Asked Answered
C

1

8

I am trying to reproduce simple example with rCharts library to plot sankey chart. I found this example from scratch and tried to reproduce it, however, I came up with some problems.

Firstly I have tried running this code without nothing. Then I found out and realized, that I need d3_sankey in my computer. So, I have downloaded it from here and copied to C:\Users\adomas\Documents\R\win-library\3.0\rCharts\libraries\widgets\d3_sankey.

Then I've tried that unchanged code once more and still got the following error:

Error in file(con, "r") : cannot open the connection In addition: Warning message: In file(con, "r") : cannot open file '/config.yml': No such file or directory

Since that didn't help too, I have tried changing paths from: sankeyPlot$setLib('libraries/widgets/d3_sankey') sankeyPlot$setTemplate(script = "libraries/widgets/d3_sankey/layouts/chart.html")

to

sankeyPlot$setLib('C:/Users/adomas/Documents/R/win-library/3.0/rCharts/libraries/widgets/d3_sankey') sankeyPlot$setTemplate(script = "C:/Users/adomas/Documents/R/win-library/3.0/rCharts/libraries/widgets/d3_sankey/layouts/chart.html")

However, this time, the blank screen in Viewer appeared but no actual Sankey graph and I got the following in console: Warning message: In readLines(file, warn = warn, ...) : invalid input found on input connection 'C:/Users/adomas/Documents/R/win-library/3.0/rCharts/libraries/widgets/d3_sankey/layouts/chart.html

I have tried changing paths and etc, but still something is wrong. And I am not sure if I need to use sankeyPlot$setTemplate at all. I want to use Sankey chart in my shiny application, but firstly I want to reproduce simply in R. Suggestions would help a lot!

Versions of libraries: rCharts_0.4.2 igraph_0.7.0 R version: 3.0.2

EDITED: I have tried this code on different system. And everything works there. Versions of libraries and R are the same and I've copied same documents and just specified full path. I have tried that again on my own computer, but still got the same error yet.

Classics answered 24/2, 2014 at 11:7 Comment(0)
C
2

Alright, eventually it works as it should be.

I just rebooted my system and that's it. However, if anyone would come up with same problem, just be sure you specify direct path, where you placed all necessary files for d3_sankey. Therefore, you rather use sankeyPlot$setLib('C:/Users/adomas/Documents/R/win-library/3.0/rCharts/libraries/widgets/d3_sankey')

This is wonderful chart type. Good luck!

Classics answered 24/2, 2014 at 13:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.