ropensci / rnaturalearth

An R package to hold and facilitate interaction with natural earth map data :earth_africa:
http://ropensci.github.io/rnaturalearth/
Other
214 stars 24 forks source link

Caching data? #74

Open PMassicotte opened 1 year ago

PMassicotte commented 1 year ago

library(pins)

url <- board_url(
  c("nh" = "https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_1_states_provinces.zip")
)

file <- pin_download(url, "nh") |>
  fs::path_expand()

sf::st_read(paste0("/vsizip/", file))