4

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?

Community
  • 1
  • 1
Centure
  • 51
  • 1
  • 3
  • 1
    Are you on a 32-bit Windows? – Calimo Dec 21 '16 at 12:50
  • 64-bit and 20GB of ram. – Centure Dec 21 '16 at 13:34
  • What function are you calling (i.e. can you provide more of an example)? Also, you should consider posting this as an issue to the pkg github. Ask them to make this a parameter (depending on what function you're calling). You may be able to pass these params to `knit_print()` if you're calling that directly or indirectly. – hrbrmstr Dec 21 '16 at 13:55
  • not familiar with R, but it calls `exec_command "pandoc"` or something similar, and there you need it to pass e.g. `pandoc +RTS -M2048` to increase the haskell runtime memory to 2048MBs... also try scaling down images before using them in your markdown document... see also http://stackoverflow.com/questions/30704736/ – mb21 Dec 21 '16 at 17:02
  • I'm trying to call: `mapview(testmap, burst=T, zcol=c("x", "y", "z"), alpha.regions = "0.4", legend=T, layer.name=c("x","y","z"))` After this I can export this mapview from Rstudio using the built-in export-tool, i.e. create a standalone html file OR I can use function `mapshot(m, url=paste0(getwd(), "/heatmap.html"))`. `m` being the mapview I created. – Centure Dec 23 '16 at 11:04

3 Answers3

1

Having the same problem, One potential solution could be https://jonathanchang.org/coding/fixing-pandoc-out-of-memory-errors-on-windows/ Unable to try it at my end since I do not have a VS license.

vijayvithal
  • 551
  • 1
  • 5
  • 13
  • Me neither. 4096 is a bit excessive, if I could get it to at least 1024 I'd be happy. Yet, still no luck. – Centure Dec 28 '16 at 14:15
0

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.

vijayvithal
  • 551
  • 1
  • 5
  • 13
0

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