r <-rast(system.file("ex/elev.tif", package="terra"))
s <- c(r, 1/r, sqrt(r))
names(s) <- c("elevation", "inverse", "sqrt")
pairs(s)
# to make indvidual histograms:
hist(r)
# or scatter plots:
plot(s[[1]], s[[2]])
Run the code above in your browser using DataLab