I essentially have the same issue described here, but this question has not been answered Can I resample a raster in R using "max" as function?.
I have a elevation raster with a resolution of 100m. I would like to resample to create a new dataset that has the same grid as another raster I'm using, lets say landcover, which has a resolution of 4500m. I would like the value in the new dataset to be the standard deviation of elevation within the new grid cell.
It seems to me like both the aggregate and resample functions each do one of the things I need to do, but not the other. Aggregate would allow me to specify the stdev function, but it doesn't seem like I can get the grid to match another raster. Resample would allow me to match the grid of another raster, but I can't use stdev as the resampling function.
How could I approach this problem?
exactextractr::exact_resample(elev, landcov, 'stdev')
?