无法将“webshot”与RStudio云一起使用

无法将“webshot”与RStudio云一起使用,r,rstudio,rstudio-server,R,Rstudio,Rstudio Server,每次我尝试使用webshot包使用RStudio Cloud绘制任何内容时,我都会得到一个错误。例如: #install webshot library(webshot) webshot::install_phantomjs() # Make the graph my_graph=wordcloud2(demoFreq, size=1.5) # save it in html library("htmlwidgets") saveWidget(my_graph,"tmp.html",selfco

每次我尝试使用webshot包使用RStudio Cloud绘制任何内容时,我都会得到一个错误。例如:

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

QXcbConnection: Could not connect to display :0
PhantomJS has crashed. Please read the bug reporting guide at
<http://phantomjs.org/bug-reporting.html> 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
QXcbConnection:无法连接到显示器:0
幻影已经崩溃了。请阅读错误报告指南,网址为
并提交错误报告。
webshot中的错误(“tmp.html”,“fig_1.png”,延迟=5,vwidth=480,vheight=480):
webshot.js返回的失败值:-6