Stacking an existing RasterStack multiple times
My question is pretty similar to an unfortunately unanswered issue recently posted on Stackoverflow . I am dealing with a RasterStack object consisting of twelve layers (one for each month of the year), and I would like to replicate the layers ten times, ending up with a RasterStack consisting of 120 layers, with every 12th layer being similar (i.e., layer 1 is the same like layer 13 is the same like layer 25 and so on). For replication purposes, let's take an example from the raster package: library(raster) file <- system.file("external/test.grd", package = "raster") s <- stack(file, file,