Increasing pandoc memory allocation using mapview in R

4.2k views Asked by At

I'm trying to export my mapview in R using built-in mapview-function called mapshot. I get this error message:

pandoc.exe: Out of memory

Error: pandoc document conversion failed with error 251

In addition: Warning message: running command 'C:/PROGRA~2/Pandoc/pandoc +RTS -K512m -RTS ...

How do I increase the Pandoc memory size permanently in R without using a Rmarkdown-file?

2

There are 2 answers

0
vijayvithal On

I got this working for my case, I did not use mapshot. My solution uses

```{r mappImage,screenshot.force = TRUE}

for the chunks where I need to replace the interactive map with an png image. The screenshot.force=TRUE option uses webshot and phantomJS( webshot::install_phantomjs() ) in the background.

0
Raul Maldonado On

I commented out the install.packages operations to avoid memory overload. The implementation of this idea worked. However, some output was slightly different.