Search code examples
rleafletrstudior-sfr-mapview

Cannot display mapview output after installing R 4.0.0


After I installed the R 4.0.0, I cannot display the mapview output in the viewer of RStudio. It would be great if someone can give me some hints to solve this.

Here is an example code.

library(mapview)

mapview(breweries)

And here is a screenshot of my RStudio Viewer. There is no error message, but the viewer is just blank.

enter image description here

Here is my session information, and I am using RStudio Version 1.1.442.

sessionInfo()
# R version 4.0.0 (2020-04-24)
# 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     
# 
# other attached packages:
# [1] mapview_2.7.8
# 
# loaded via a namespace (and not attached):
#  [1] Rcpp_1.0.4.6            RColorBrewer_1.1-2      compiler_4.0.0          base64enc_0.1-3         class_7.3-17           
#  [6] tools_4.0.0             digest_0.6.25           uuid_0.1-4              jsonlite_1.6.1          satellite_1.0.2        
# [11] lifecycle_0.2.0         lattice_0.20-41         viridisLite_0.3.0       png_0.1-7               rlang_0.4.6            
# [16] DBI_1.1.0               crosstalk_1.1.0.1       yaml_2.2.1              e1071_1.7-3             raster_3.1-5           
# [21] leaflet.providers_1.9.0 gdtools_0.2.2           htmlwidgets_1.5.1       systemfonts_0.2.3       stats4_4.0.0           
# [26] classInt_0.4-3          leaflet_2.0.3           grid_4.0.0              webshot_0.5.2           svglite_1.2.3          
# [31] sf_0.9-3                R6_2.4.1                sp_1.4-2                leafpop_0.0.5           magrittr_1.5           
# [36] scales_1.1.1            codetools_0.2-16        htmltools_0.4.0         units_0.6-6             colorspace_1.4-1       
# [41] brew_1.0-6              KernSmooth_2.23-17      munsell_0.5.0           leafem_0.1.1

Solution

  • This seems to be an issue of some combinations of RStudio, R and leaflet versions on Windows, see these GitHub issues:

    Try to upgrade your RStudio, maybe it'll help (at least they say it's fixed for RStudio v1.3.957-1).