| pairs,stars-method | R Documentation | 
Pairs plot of attributes for stars objects. This is equivalent to
terra::pairs() but works with stars objects.
## S4 method for signature 'stars'
pairs(
  x,
  hist = TRUE,
  cor = TRUE,
  use = "pairwise.complete.obs",
  maxcells = 1e+05,
  ...
)
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)  | 
a pairs plot of the attributes of the stars object.
r <- terra::rast(system.file("ex/elev.tif", package = "terra"))
s <- c(r, 1 / r, sqrt(r))
names(s) <- c("elevation", "inverse", "sqrt")
terra::pairs(s)
s_stars <- stars::st_as_stars(s, as_attributes = TRUE)
pairs(s_stars)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.