0

今天早上我能够在一台计算机上成功使用 pander,但现在我正尝试在自己的计算机上进行操作,但遇到了一些奇怪的问题。

这是我非常基本的 R Pander 代码:

library("pander")
library("knitr")

test<-Pandoc$new("My Name","Test")

test$add.paragraph('# Welcome to Test')
test$add.paragraph('*****')

#works so far but here it won't work
test$add(3+3)
#here I get error in dev.control(displaylist = "enable"):
# dev.control() called without an open grpahics device
# In addition: Warning message:
#In png("plots/....png", width=480,height=480,res=72, : failed to load cairo DLL

我真的不能使用 $add 来添加 R 代码,我不明白为什么。如果有人可以提供帮助,我将不胜感激。

问候

编辑:

R version 3.2.1 (2015-06-18)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.4 (Yosemite)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] knitr_1.10.5    rmarkdown_0.7   rapport_0.51    yaml_2.1.13     plyr_1.8.3      lattice_0.20-33 pander_0.5.2    brew_1.0-6     

loaded via a namespace (and not attached):
[1] htmltools_0.2.6 tools_3.2.1     Rcpp_0.12.0     reshape_0.8.5   grid_3.2.1      digest_0.6.8  
4

1 回答 1

0

看来我没有安装 XQuartz。我安装了它,一切正常,所以谢谢你和 köszönöm 的帮助。

于 2015-07-31T02:34:59.060 回答