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