maxpixels
.hist(x, ...)
hist
plot=TRUE
).hist(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 histogram
see hist
for the other argumentsplot
and hist
r1 <- raster(nrows=50, ncols=50)
r1 <- setValues(r1, runif(ncell(r1)))
r2 <- setValues(r1, runif(ncell(r1)))
rs <- r1 + r2
rp <- r1 * r2
par(mfrow=c(2,2))
plot(rs, main='sum')
plot(rp, main='product')
hist(rs)
a = hist(rp)
a
Run the code above in your browser using DataLab