density(x, ...)density(x, layer, maxpixels=100000, plot=TRUE, main, ...)
layer can be used to subset the layers to plot in a multilayer object (RasterBrick or RasterStack)
maxpixels is the maximum number of (randomly sampled) cells to be used for creating the density plot
see plot for the other arguments