8

I'm having a problem exporting graphs in R to PDFs using DiagrammeR's export_graph function in RStudio.

Example below to reproduce the problem. The PDFs are produced inconsistently so sometimes not at all.

The error message I get is on calling the export_graph in the code snipet below.

I'm using RStudio Version 1.1.463 and R 3.5.2 on Windows 10.

"\<"unknown">":1919791: Invalid asm.js: Function definition doesn't match use"

library(data.tree)
library(yaml)
library(DiagrammeR)
library(DiagrammeRsvg)

fileName <- system.file("extdata", "jennylind.yaml", package="data.tree")
cat(readChar(fileName, file.info(fileName)$size))
lol <- yaml.load_file(fileName)
jl <- as.Node(lol)
pic <- ToDiagrammeRGraph(jl)
render_graph(pic)
export_graph(pic, "C:/Tmp/plot.pdf", file_type = "pdf")
Brian
  • 7,900
  • 1
  • 27
  • 41

0 Answers0