I have noticed that z values of a raster brick get lost when that brick is
cropped using the 'crop' function in the raster package.
I am running R 3.0.1 64 bit on Windows 7 and raster package 2.1-38.
The example below illustrates the issue.

require(raster)
r <- raster(nrow=45, ncol=90);r[]<-rnorm(45*90)
r<-brick(r,r,r)

r<-setZ(r,as.Date(c("2001-01-01","2001-01-02","2001-01-03")))

r.cropped <- crop(r,extent(-90,90,-10,10))
getZ(r)
getZ(r.cropped)

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to