# NOT RUN {
# creating random data in the correct data format
xyzdf <- expand.grid(x = c(1:3), y = c(1:3))
xyzdf$z1 <- runif(9)
xyzdf$z2 <- runif(9)
xyzdf$z3 <- runif(9)
zstack <- RastStackData(xyzdf)
dim(zstack)
terra::plot(zstack[[1]])
terra::plot(zstack[[2]])
terra::plot(zstack[[3]])
# }
Run the code above in your browser using DataLab