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)