rtargets-r-package

Non-interactive tar_visnetwork()/tar_glimpse()?


Background: I work in terminal R on a remote system and don't have interactive graphical capabilities. Perhaps I could manage to get X11 working but so far I have been productive using some workarounds, rendering plots to file directly and mounting the remote image dir using sshfs.

Interactive graphics don't work for me but I'd like to visualize target dependencies. Is it possible to somehow render tar_visnetwork() to a static image? Something like the following (which doesn't work)?:

png('test.png')
tar_visnetwork()
dev.off()

Solution

  • tar_visnetwork creates a HTML widget. You can render this file in your local Browser:

    library(targets)
    library(htmltools)
    
    save_html(html = tar_visnetwork(), file = "dag.html")