density: Density plot

Description Usage Arguments Value Examples

Description

Create density plots of values in a Raster object

Usage

1
2
## S4 method for signature 'Raster'
density(x, layer, maxpixels=100000, plot=TRUE, main, ...)

Arguments

x

Raster object

layer

numeric. Can be used to subset the layers to plot in a multilayer object (RasterBrick or RasterStack)

maxpixels

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

main title for each plot (can be missing)

...

Additional arguments passed to base plot

Value

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

Examples

1
2
logo <- stack(system.file("external/rlogo.grd", package="raster")) 
density(logo)

Example output

Loading required package: sp
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files

raster documentation built on Jan. 5, 2021, 3:01 a.m.