x <- sqrt(1:100)
mat <- matrix(x, 10, 10)
r1 <- rast(nrows=10, ncols=10, xmin=0, vals = x)
r2 <- rast(nrows=10, ncols=10, xmin=0, vals = t(mat))
identical(r1, r2)
identical(r1, r1*1)
identical(rast(r1), rast(r2))
Run the code above in your browser using DataLab