RStudio不渲染Sankey

时间:2016-11-17 17:22:11

标签: r data-visualization sankey-diagram

寻找帮助,找出为什么此代码不会在RStudio查看器中呈现Sankey或其他方式。我认为这可能是我的R版本(3.3.1)的问题......我正在使用的软件包是在3.3.1下构建的。不幸的是,我的组织需要一段时间来更新企业...

library(devtools)
library(rjson)
library(igraph)
library(rCharts)

x = read.csv('./R/dataforR.csv', header=TRUE)

colnames(x) <- c("UID","From", "To", "Avg.Hours")

sankeyPlot <- rCharts$new()

sankeyPlot$set(
data = x,
nodeWidth = 115,
nodePadding = 110,
layout = 132,
width = 1500,
height = 1300,
units = "hrs",
title = "New Sankey"
)
sankeyPlot$setLib('http://timelyportfolio.github.io/rCharts_d3_sankey')

sankeyPlot

1 个答案:

答案 0 :(得分:0)

sankeyPlot$setLib('http://timelyportfolio.github.io/rCharts_d3_sankey')中的地址不正确。

根据this SO question,它应该是:

sankeyPlot$setLib('http://timelyportfolio.github.io/rCharts_d3_sankey/libraries/widgets/d3_sankey')