使用d3_sankey再现Sankey图示例时出现问题 [英] Problems while reproducing Sankey chart example with d3_sankey

查看:439
本文介绍了使用d3_sankey再现Sankey图示例时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用 rCharts 库来重现简单的例子以绘制 sankey 图表。我发现这个例子从头开始,并尝试重现它,但是,我想出了一些问题。

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.

首先,我试着运行这段代码。然后我发现和意识到,我需要在我的电脑上的d3_sankey。因此,我已从此处下载并复制到 C:\Users\adomas\Documents\R\win- library\3.0\rCharts\libraries\widgets\d3_sankey

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:

文件中出错(con,r):无法打开连接
此外:警告消息:
在文件(con,r)中:
无法打开文件' /config.yml':没有这样的文件或目录

由于这没有帮助,我试图更改路径:
sankeyPlot $ setLib('libraries / widgets / d3_sankey')
sankeyPlot $ setTemplate(script =libraries / widgets / d3_sankey / layouts / chart.html)

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")

sankeyPlot $ setLib('C:/ Users / adomas /文档/ 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)

但是,此时,查看器中出现空白屏幕,但没有实际的Sankey图我在控制台中得到以下:
警告消息:
在readLines(文件,warn = warn,...):
在输入连接上找到无效输入' 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

我试过改变路径等,但仍然有些问题。我不知道是否需要使用 sankeyPlot $ setTemplate
我想在闪亮的应用程序中使用Sankey图表,但首先我想在R中复制。建议会有很多帮助。

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!

库的版本:
rCharts_0.4.2
igraph_0.7.0
R版本: 3.0.2

EDITED:
我在不同的系统上尝试过此代码。一切都在那里工作。库和R的版本是相同的,我复制了相同的文档,只是指定完整路径。我已经在我自己的计算机上再次尝试,但仍然有相同的错误。

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.

推荐答案

好吧,应该。

我刚刚重新启动了我的系统。然而,如果任何人会出现同样的问题,只要确保你指定直接路径,你放置所有必要的文件d3_sankey。因此,你宁愿使用
sankeyPlot $ setLib('C:/Users/adomas/Documents/R/win-library/3.0/rCharts/libraries/widgets/d3_sankey')

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!

这篇关于使用d3_sankey再现Sankey图示例时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆