I am working with a raster file that represents the percentage of vineyards by commune (e.g., municipality) in a region in France. The statistics were calculated for each commune based on surveys from the ministry of agriculture. My problem is that the statistics and the resulting raster were elaborated by a colleague and our boundaries for different communes do not match. In other words, some cells which have the label for one commune according to my commune polygon vector (and rasterized afterwards) have the label of other commune in according to his map. I though I could create a new raster in which a unique value is given for each commune using the command r.mode.
The most frequent value within each polygon could be extended to all the commune area.
I am using GRASS GIS. My problem is that the raster file has float values and r.mode requires integer values.I need to transform my float values into integers, but before I need to multiply my values by 1000000 or similar since all my raster values are smaller than 0.
I would like to do it in r.mapcalc, using an expression like:
r.mapcalc value_int@covariates = int(value@covariates * 1000000)
but this expresion gives me an error.
I may not have a lot of imagination, so if any solution can be done in R, I would also be really thankful.