You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
r <- raster(paste0(path, "zambia_s1_s2_crop_type_rf_2022_87k_noshrub.tif"))
#plot(r, col=rainbow(7))
v <- shapefile("D:/Adm data/Zambia/2010 Districts/district_74_dd.shp")
a=aa[aa==1]
aa <- exact_extract(r, v, "count")
# count the number of cells in each class with freq
freq(r)
#To compute the area of each class:https://stackoverflow.com/questions/72945527/calculate-polygon-area-for-each-land-cover-type-using-spatraster-object