file <- system.file("external/test.grd", package="raster")
s <- stack(c(file, file))
if (FALSE) {
s <- stackSave(s, "mystack")
# note that filename adds an extension .stk to a stackfile
s2 <- stackOpen("mystack.stk")
s2
}
Run the code above in your browser using DataLab