I've been playing around with the mapview package which has recently been loaded onto CRAN. I've been playing with the demo code and trying to embed it into a knitr markdown document. Unfortunately, I get an error message when I do this and I'm having trouble interpreting what is going wrong.
Here is the error message, followed by a reproducible example. Note that I don't have any problem when running the code as straight-up R code. It's only when it is run through knitr that the problem presents itself. The error does not occur if the mapview
elements are commented out.
I've updated all of my packages and the problem persists. Here are some system details:
- Windows 7
- R version 3.2.2
- R Studio version 0.99.486
- mapview version 1.0.0
- knitr version 1.11
- pandoc version 1.13.1
pandoc.exe: Could not fetch C:\Users\my.name\Documents\R\win-library\3.2\mapview\htmlwidgets\lib\leaflet#default#VML C:\Users\my.name\Documents\R\win-library\3.2\mapview\htmlwidgets\lib\leaflet: openBinaryFile: does not exist (No such file or directory) Error: pandoc document conversion failed with error 67 In addition: Warning message: running command '"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS Mapview.utf8.md --to html --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output Mapview.html --smart --email-obfuscation none --self-contained --standalone --section-divs --template "C:\Users\my.name\Documents\R\win-library\3.2\rmarkdown\rmd\h\default.html" --variable "theme:bootstrap" --include-in-header "C:\Users\my.name\AppData\Local\Temp\Rtmpw9Mi9D\rmarkdown-str1ee41c515f3f.html" --mathjax --variable "mathjax-url:https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" --no-highlight --variable "highlightjs=C:\Users\my.name\Documents\R\win-library\3.2\rmarkdown\rmd\h\highlight"' had status 67 Execution halted
---
title: "Test Mapview"
output: html_document
---
```{r}
library(ggplot2)
library(rgdal)
library(mapview)
data(diamonds)
### blow diamonds up a bit
big <- diamonds[rep(seq_len(nrow(diamonds)), 1), ]
big$cut <- as.character(big$cut)
big$color <- as.character(big$color)
big$clarity <- as.character(big$clarity)
### provide some random positions
big$x <- rnorm(nrow(big), 0, 10)
big$y <- rnorm(nrow(big), 0, 10)
coordinates(big) <- ~x+y
proj4string(big) <- CRS("+init=epsg:4326")
### view it
mapview(big)
```