0

I am trying to knit a flexdashboard to an html file. My flexdashboard includes leaflet maps. The knit.md file compiles correctly. At the last stage, converting the knit.md to an html file, I get an error. Apparently leaflet is looking for html dependencies in the R 3.3.2 folder, rather than the R 3.4.2 folder. I originally built this flexdashboard months ago on a different machine on which I had R 3.3.2 (although I was using 3.4.1 I believe to build this). So the problem appears to be that leaflet still looks in the old R-3.3.2 folder for its dependencies even though I've updated and reinstalled leaflet multiple times, trying to fix this problem.

Does anyone know how to tell leaflet to look in the correct place for its html dependencies?

output file: myflexdashboard.knit.md

Error: path for html_dependency not found: C:/R/R-3.3.2/library/leaflet/htmlwidgets/lib/leaflet-providers

> sessionInfo()
R version 3.4.2 (2017-09-28)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] compiler_3.4.2      backports_1.1.1     magrittr_1.5        rprojroot_1.2       htmltools_0.3.6    
 [6] tools_3.4.2         flexdashboard_0.5.1 yaml_2.1.15         Rcpp_0.12.14        stringi_1.1.6      
[11] rmarkdown_1.8       knitr_1.17          jsonlite_1.5        stringr_1.2.0       digest_0.6.12      
[16] packrat_0.4.8-1     evaluate_0.10.1    
Adrian Martin
  • 780
  • 7
  • 21
  • Note: I temporarily fixed this by just copying my leaflet library from the R 3.4.2 folder into a new R 3.3.2 folder, but that's not a real long-term fix. – Adrian Martin Dec 06 '17 at 15:06
  • [You didn't provide a reprex](https://yihui.name/en/2017/09/the-minimal-reprex-paradox/), so the best thing we could do is guessing. If you cached the chunk containing HTML widgets, you may need to invalidate the cache after you update R packages. – Yihui Xie Dec 06 '17 at 19:00
  • Sorry for not providing runable code, but I wasn't able to reproduce the error with a markdown file that I could share. My markdown was not previously cached. – Adrian Martin Dec 07 '17 at 15:13

0 Answers0