I'm downloading data from the National Land Cover database using the get_nlcd tool from the FedData package. Here is an example for documentation for this package
library(FedData)
vepPolygon <- polygon_from_extent(raster::extent(672800,740000,4102000,4170000),
proj4string='+proj=utm +datum=NAD83 +zone=12')
# Get the NLCD (USA ONLY)
# Returns a raster
Veg <- get_nlcd(template=vepPolygon, label='VEPIIN',force.redo=TRUE)
#Get Land Use Stats
LandUseStats<-as.data.frame(Veg@data@attributes)
LandUseStats<-LandUseStats[!LandUseStats$Count == 0,]
LandUseStats
ID OID Value Count Red Green Blue NLCD.2011.Land.Cover.Class Opacity
1 0 0 0 7854240512 0 0 0 Unclassified 1
12 11 11 11 469012527 0 0 0 Open Water 1
13 12 12 12 1599206 0 0 0 Perennial Snow/Ice 1
22 21 21 21 292251633 0 0 0 Developed, Open Space 1
23 22 22 22 131633826 0 0 0 Developed, Low Intensity 1
24 23 23 23 59456652 0 0 0 Developed, Medium Intensity 1
25 24 24 24 21426522 0 0 0 Developed, High Intensity 1
32 31 31 31 110507264 0 0 0 Barren Land 1
42 41 41 41 973617734 0 0 0 Deciduous Forest 1
43 42 42 42 1037912310 0 0 0 Evergreen Forest 1
44 43 43 43 179845520 0 0 0 Mixed Forest 1
53 52 52 52 1940362409 0 0 0 Shrub/Scrub 1
72 71 71 71 1306961628 0 0 0 Herbaceuous 1
82 81 81 81 597234572 0 0 0 Hay/Pasture 1
83 82 82 82 1392218141 0 0 0 Cultivated Crops 1
91 90 90 90 347144473 0 0 0 Woody Wetlands 1
96 95 95 95 116679631 0 0 0 Emergent Herbaceuous Wetlands 1
#Compare to plot
plot(Veg)
If I understand the "Count" to be the number of pixels represented in the associated plot, then when comparing the plot to the Stats, the two don't seem to match. Nor do I understand why close to half the data is "unclassified".
Is there a better way to extract the land use data used in the plot?