density: Density plot

Description Usage Arguments Value Examples

Description

Create density plots of the cell values of a SpatRaster

Usage

1
2
## S4 method for signature 'SpatRaster'
density(x, maxcells=100000, plot=TRUE, main, ...)

Arguments

x

SpatRaster

maxcells

the maximum number of (randomly sampled) cells to be used for creating the plot

plot

if TRUE produce a plot, else return a density object

main

character. Caption of plot(s)

...

additional arguments passed to plot

Value

density plot (and a density object, returned invisibly if plot=TRUE)

Examples

1
2
logo <- rast(system.file("ex/logo.tif", package="terra"))
density(logo)

terra documentation built on Aug. 20, 2021, 9:07 a.m.