I am trying to insert image from online inside node in digrammer R but it giving error unable to open https://www.r-project.org/logo/Rlogo.png

library(DiagrammeR)
library(png)

img <- png::readPNG("https://www.r-project.org/logo/Rlogo.png")

my_graphviz <- "
digraph {
graph[rankdir = LR]

node[shape = rectangle, style = filled]
A[label = '', shape = none, image = img, labelloc = b]
B[label = 'Analysis.R']
C[label = 'Data.csv']

edge[color = black]
B -> A
C -> B
}
"

img_str <- base64enc::dataURI(img, mime = "image/png")

my_graphviz <- gsub("img", img_str, my_graphviz)

render_graph(my_graphviz)

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.