0

I was able to use pander successfully this morning on one computer, but now I am trying to do it on my own computer, and I am having some weird issues.

Here is my very elementary R Pander code:

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

I literally can't use $add to add R code, and I don't understand why. I would greatly appreciate if someone could help.

Regards

edit:

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  
Carl
  • 5,569
  • 6
  • 39
  • 74
  • 1
    Seems like a bug -- can you please share your `sessionInfo()` and try the same with the most recent version of `pander` from GitHub: https://github.com/Rapporter/pander#installation -- and maybe opening a ticket there. **Edit:** thanks for the quick update. Can you please update the `pander` package? `0.5.1` is really old. – daroczig Jul 30 '15 at 03:46
  • 1
    How did you install `R`? Something seems to be wrong with `XQuartz` so it can't load a `cairo dll` which is used for plotting (it's a 2D plotting library). Seems like other users had similar problems (http://stackoverflow.com/questions/14009606/homebrew-r-build-missing-cairo https://stat.ethz.ch/pipermail/r-sig-mac/2014-October/011135.html), so I highly doubt that it's connected to `pander` – romants Jul 30 '15 at 04:52
  • 1
    XQuartz is no longer installed by default in OSX. Users need to download and install it separately. So maybe it wasn't reinstalled when Carl updated? – IRTFM Jul 30 '15 at 20:56
  • XQuartz was the problem. Thank you to everyone for the help – Carl Jul 31 '15 at 02:36

1 Answers1

0

It appears I did not have XQuartz installed. I installed it and everything works so thank you and köszönöm for the help.

Carl
  • 5,569
  • 6
  • 39
  • 74