pairs | R Documentation |
Pair plots of layers in a SpatRaster. This is a wrapper around graphics function pairs
.
## S4 method for signature 'SpatRaster'
pairs(x, hist=TRUE, cor=TRUE, use="pairwise.complete.obs", maxcells=100000, ...)
x |
SpatRaster |
hist |
logical. If TRUE a histogram of the values is shown on the diagonal |
cor |
logical. If TRUE the correlation coefficient is shown in the upper panels |
use |
argument passed to the |
maxcells |
integer. Number of pixels to sample from each layer of a large SpatRaster |
... |
additional arguments (graphical parameters) |
boxplot, hist
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]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.