Skip to content

Instantly share code, notes, and snippets.

@mschmidty
Last active December 8, 2021 00:12
Show Gist options
  • Save mschmidty/13e5472dbe0b5192a186dc968f404f56 to your computer and use it in GitHub Desktop.
Save mschmidty/13e5472dbe0b5192a186dc968f404f56 to your computer and use it in GitHub Desktop.
rOpenSci FedData

FedData github page

Makesure to download the development version. In the CRAN version downloading get_nlcd() is broken.

devtools::install_github("ropensci/FedData")
library(FedData)
library(tigris)  ## to get county level data  
library(sf)
library(raster)
library(tidyverse)
co_counties<-tigris::counties(state="Colorado")

extent_for_dat<-co_counties%>%
  dplyr::filter(NAME %in% c("Montezuma"))

nlcd<-FedData::get_nlcd(extent_for_dat, label="sw_colorado")
plot(nlcd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment