# NOT RUN {
ctryPoly <- rgdal::readOGR(getPolyFnamePath("KEN"), getCtryShpLyrNames("KEN", 1))
ctryRaster <- raster::raster(getCtryRasterOutputFnamePath("KEN", "OLS", "1999"))
temp <- NULL
KenAdm1Sum <- NULL
for (i in 1:length(ctryPoly@polygons))
{
temp$name <- as.character(ctryPoly@data$NAME_1[i])
temp$sum <- sum(masqOLS(ctryPoly, ctryRaster, i), na.rm=T)
KenAdm1Sum <- rbind(KenAdm1Sum)
}
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab