Showing results for 
Search instead for 
Did you mean: 
morganvillette Frequent Visitor
Frequent Visitor

R visual - NetworkD3 package



I need the sankey visual from this package cause the one of Power BI isn't adequate for my task but I struggle and I don't know why ...


So basically, I import this R code to load my data:

nodes <- read.table("C:/nodes.txt",header=TRUE)
links <- read.table("C:/links.txt",header=TRUE,sep=",")
data <- merge(nodes,links)

So here, I basically merge those two tables to trick Power BI (cause he can only load one dataframe, I basically do it before him by merging and having all information I need)


Then, I use the R visual and put my code into it, this code:


# dataset <- data.frame(name, volume, target, source)
# dataset <- unique(dataset)

links <- unique(dataset[c("source","target","volume")])
nodes <- unique(dataset[c("name")])
networkD3::sankeyNetwork(Links = links, Nodes = nodes,
Source = 'source',
Target = 'target',
Value = 'volume',
NodeID = 'name')


But Power BI says that my code doesnt create any image. I know my dataset preparation is good because i can do a histogram easily but I can't have sankey image from it and I don't know why since this is a package supported by Power BI ?


What I suspect is that since this sankey function produces an HTML output, maybe that's why it doesn't work on Power BI ?


Best regards,



Community Support Team
Community Support Team

Re: R visual - NetworkD3 package

Hi @morganvillette ,


I think this should more related to R script security, current power bi service not allow your to direct user r script code to invoke external datasource.(these operations works on desktop side)

Please take a look at following document to know more about this limitation:

Creating R visuals in the Power BI service



Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

For learning resources/Release notes, please visit: | |