Centure
Centure

Reputation: 61

Increasing pandoc memory allocation using mapview in R

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?

Upvotes: 5

Views: 4354

Answers (3)

Anna Dorrance
Anna Dorrance

Reputation: 1

I got a similar pandoc error when using mapshot. The R documentation for mapshot states "In case you want to save larger maps mapshot is likely to fail. You can try setting selfcontained = FALSE to avoid errors and create a valid local html file." Adding selfcontained = FALSE seemed to fix my issue. Making my code mapshot(mapview_object, url = "C:/test.html", remove_controls = NULL, selfcontained = FALSE)

Upvotes: 0

Raul Maldonado
Raul Maldonado

Reputation: 9

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

Upvotes: -1

vijayvithal
vijayvithal

Reputation: 581

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.

Upvotes: -1

Related Questions