I would like to create the static map using R and Mapdeck. I am doing it for the first time, and I just want just any png map output at this stage. (Eventually I want to create USA map with 50 states and with extended horizontal bar charts for some cities.)
On the website below I found a sample code. At the moment I just want a simple png of this file. I created mapdeck token, I can run this code with no errors, but I do not get any "viewer" output that would display the map that I would export to png. I have found other mapdeck/R codes on the web, and none of them display any visuals.
https://geocompr.robinlovelace.net/adv-map.html
library(mapdeck)
set_token(Sys.getenv("MAPBOX"))
df = read.csv("https://git.io/geocompr-mapdeck")
ms = mapdeck_style("dark")
mapdeck(style = ms, pitch = 45, location = c(0, 52), zoom = 4) %>%
add_grid(data = df, lat = "lat", lon = "lng", cell_size = 1000,
elevation_scale = 50, layer_id = "grid_layer",
colour_range = viridisLite::plasma(5))