r <- rast()
ncol(r)
nrow(r)
nlyr(r)
dim(r)
nsrc(r)
ncell(r)
rr <- c(r,r)
nlyr(rr)
nsrc(rr)
ncell(rr)
nrow(r) <- 18
ncol(r) <- 36
# equivalent to
dim(r) <- c(18, 36)
dim(r)
dim(r) <- c(10, 10, 5)
dim(r)
xres(r)
yres(r)
res(r)
res(r) <- 1/120
# different xres and yres
res(r) <- c(1/120, 1/60)
Run the code above in your browser using DataLab