Why is there no output for mapview() command in R 4.2.2 (August 2023)?

80 Views Asked by At

After installing the "mapview" package in R 4.2.2 and importing its library into a Jupyter notebook, I cannot create any maps. Although the data is loaded, any attempt to render a map figure when running a code block results in no output and no error messages.

Below are my session info and the code as an example.

sessionInfo() 
R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8 
[2] LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

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

other attached packages:
[1] geojsonio_0.11.1 mapview_2.11.0   tigris_2.0.3    

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.10         lattice_0.20-45     png_0.1-8          
 [4] class_7.3-20        digest_0.6.31       utf8_1.2.3         
 [7] V8_4.3.3            IRdisplay_1.1       R6_2.5.1           
[10] repr_1.1.6          stats4_4.2.2        evaluate_0.21      
[13] e1071_1.7-13        geojson_0.3.4       httr_1.4.6         
[16] pillar_1.9.0        rlang_1.1.1         lazyeval_0.2.2     
[19] curl_5.0.1          uuid_1.1-0          raster_3.6-23      
[22] webshot_0.5.5       jqr_1.2.3           stringr_1.5.0      
[25] htmlwidgets_1.6.2   munsell_0.5.0       proxy_0.4-27       
[28] compiler_4.2.2      pkgconfig_2.0.3     base64enc_0.1-3    
[31] htmltools_0.5.5     tidyselect_1.2.0    httpcode_0.3.0     
[34] tibble_3.2.1        codetools_0.2-18    fansi_1.0.4        
[37] crayon_1.5.2        dplyr_1.1.2         sf_1.0-14          
[40] rappdirs_0.3.3      crul_1.4.0          grid_4.2.2         
[43] jsonlite_1.8.5      satellite_1.0.4     lifecycle_1.0.3    
[46] DBI_1.1.3           magrittr_2.0.3      units_0.8-2        
[49] scales_1.2.1        KernSmooth_2.23-20  cli_3.6.1          
[52] stringi_1.7.12      leaflet_2.1.2       sp_2.0-0           
[55] generics_0.1.3      vctrs_0.6.2         IRkernel_1.3.2.9000
[58] geojsonsf_2.0.3     tools_4.2.2         leafem_0.2.0       
[61] glue_1.6.2          crosstalk_1.2.0     fastmap_1.1.1      
[64] colorspace_2.1-0    terra_1.7-39        classInt_0.4-9     
[67] pbdZMQ_0.3-9   

Here I install packages and upload libraries. When loading packages, I received warnings that tigris, mapview, and geojsonio were built under newer R versions than mine. This was also mentioned when installing tigris: "To enable caching of data, set `options(tigris_use_cache = TRUE)` in your R script or .Rprofile.

install.packages("tigris")
install.packages("mapview")
install.packages("geojsonio")
install.packages("dplyr")
install.packages("leaflet")
install.packages("sf")

library(tigris)
library(mapview)
library(geojsonio)
library(dplyr)
library(leaflet)
library(sf)

Then I entered the following command and the output was what seems to be a df table.

breweries

Then I attempted to create a simple map using mapview, but the code ran resulting in no output and no error message.

mapview(breweries)
mapview(breweries, zcol = "founded")

Although StackOverflow recommends not posting pictures of code, I don't know how to better explain in text or illustrate how an output doesn't exist. So here is a photo of my result.

Photo of no output when using multiple mapview(breweries) commands

0

There are 0 best solutions below