Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

pairs

Pairs plot (matrix of scatterplots)


Description

Pair plots of layers in a SpatRaster. This is a wrapper around graphics function pairs.

Usage

## S4 method for signature 'SpatRaster'
pairs(x, hist=TRUE, cor=TRUE, use="pairwise.complete.obs", maxcells=100000, ...)

Arguments

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 cor function

maxcells

integer. Number of pixels to sample from each layer of a large SpatRaster

...

additional arguments (graphical parameters)

See Also

Examples

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]])

terra

Spatial Data Analysis

v1.2-10
GPL (>= 3)
Authors
Robert J. Hijmans [cre, aut] (<https://orcid.org/0000-0001-5872-2872>), Roger Bivand [ctb] (<https://orcid.org/0000-0003-2392-6140>), Karl Forner [ctb], Jeroen Ooms [ctb] (<https://orcid.org/0000-0002-4035-0289>), Edzer Pebesma [ctb] (<https://orcid.org/0000-0001-8049-7069>)
Initial release
2021-05-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.