Cannot use webshot with RStudio Cloud

Every time I try to plot anything with RStudio Cloud using the webshot package I obtain an error. An example:

#install webshot
# Make the graph
my_graph=wordcloud2(demoFreq, size=1.5)
# save it in html
saveWidget(my_graph,"tmp.html",selfcontained = F)
# and in png
webshot("tmp.html","fig_1.png", delay =5, vwidth = 480, vheight=480)

The error says:

QXcbConnection: Could not connect to display :0
PhantomJS has crashed. Please read the bug reporting guide at
<> and file a bug report.
Error in webshot("tmp.html", "fig_1.png", delay = 5, vwidth = 480, vheight = 480) : 
  webshot.js returned failure value: -6

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