I have recently moved to using GRASS for GIS within R and I would like to extract values of a raster dataset that overlap with polygons (i.e. something like 'extract' in the raster package of R).
I can perform my task for spatial points as follows:
execGRASS("r.what", flags="n", map="temperatureRaster", Sys_input=paste(x, y, site, sep=' '), separator=",", intern=TRUE)
However, I have spatial polygons not spatial points. Eventually, I would like to calculate a mean value for all raster cells whose centroid overlaps with each spatial polygon.