I am trying to create a raster stack from a raster layer, where the raster stack is the same raster layer that is repeated a certain number of times.
I can do something like this:
library(raster)
rasterstack <- addLayer(rasterlayer, rasterLayer, rasterLayer)
and it works. However, I want the stack to be around 1000 levels. I think I could just skip, but I was wondering if there is a more complicated way to do this.
The reason I'm trying to do this is to compute the weighted average of the raster stack with data, where each level represents a different time period, and where the scales are in a different raster layer object. I hope that if I create a raster table from a weight raster layer with the same number of layers as the data, I can do something like:
weightedmean <- weighted.mean( data.RasterStack, weights.RasterStack )
source
share