I would like to create this simple igraph plot:
library(igraph)
mydata <- data.table(from=c("John", "John", "Jim"),to=c("John", "Jim", "Jack"))
mygraph <- graph_from_data_frame(d=mydata, directed=T)
plot(mygraph, vertex.label.dist=2)
With diagrammeR
library(DiagrammeR)
mygraph2 <- from_igraph(mygraph)
grViz(mygraph2)
Produces this error
Error in file.exists(diagram) : invalid 'file' argument
I've also tried with
grViz(readLines(mygraph2))
and other combinations or the command plot() but I can't find the proper way.
How can I do it?
I've openen a new question to get the same result directly with DiagrammeR, without igraph: