I am currently using a raster that is a land cover class raster (with 50 different land cover classes at a resolution of 30m). I would like to obtain 50 different rasters (essentially predictors for a future regression analysis) that are data of a continuous nature.
Previously, I used the focal statistics tool in ArcMap but I ended up obtaining either a 0 or a 1 based on areas where a particular land cover type was present.
See image below (All areas of White are 1 and Areas in black are 0):
Is there a way to obtain multiple rasters from a single land cover class raster, with the proportion of each land cover class calculated around a window of 5*5 from a particular point (instead of a 0 or a 1) in R?
I noticed that there is a focal function in the raster package.