if (FALSE) {
# Extract data for the Village Ecodynamics Project 'VEPIIN' study area:
# http://village.anth.wsu.edu
vepPolygon <- polygon_from_extent(raster::extent(672800,740000,4102000,4170000),
proj4string='+proj=utm +datum=NAD83 +zone=12')
NLCD <- get_nlcd(template=vepPolygon, label='VEPIIN')
NLCD <- as.matrix(table(raster::values(NLCD)))
cols <- dplyr::filter(pal_nlcd(), code %in% row.names(NLCD))
par(xpd = TRUE, mar = c(10, 3, 2, 1))
barplot(NLCD, beside = FALSE, col = cols$color)
legend("bottom", legend = cols$description, fill = cols$color,
ncol = 2, inset = c(0, -0.6))
}
Run the code above in your browser using DataLab