I've been working with some raster data (19 years of precipitation data) and a shapefile. The raster extent represents a square-shaped area and the shapefile is within the extent of the raster.
I want to obtain the average monthly rainfall, I mean the average rainfall for each month for all the time series.
Each month has 19 relevant rasters (from the time series period) and I can get the average rainfall which results to be a single raster for each month but don't know how to get the areal average rainfall (a single value that represents the rainfall within the shapefile).
I loaded the rasters as single objects in R. The
mean(r1, r2, r3) gives a raster as output, I want a single value that represents only the area of study.
So far I've been working with R and was wondering if I can get that calculation using the
raster package or any other package.