R looks in the wrong place for html dependency

2019-08-21 08:40发布

问题:

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