library(MazamaCoreUtils)
# Fail gracefully if the resource is not available
try({
# US Census 2019 shapefiles
url <- "https://www2.census.gov/geo/tiger/GENZ2019/shp/"
# Extract links
dataLinks <- html_getLinks(url)
dataLinks <- dataLinks %>%
dplyr::filter(stringr::str_detect(linkName, "us_county"))
head(dataLinks, 10)
}, silent = FALSE)
Run the code above in your browser using DataLab