Description Usage Arguments Value See Also Examples
Linear stretch of values in a Raster object. Provide the desired output range (minv and maxv) and the lower and upper bounds in the original data, either as quantiles (if minq=0
and maxq=1
you use the minimum and maximum cell values), or as actual values (smin
and smax
; e.g. precomputed quantile values). If smin
and smax
are both not NA
, minq
and maxq
are ignored.
1 2 3 |
x |
Raster object |
minv |
numeric >= 0 and smaller than maxv. lower bound of stretched value |
maxv |
numeric <= 255 and larger than maxv. upper bound of stretched value |
minq |
numeric >= 0 and smaller than maxq. lower quantile bound of original value. Ignored if smin is supplied |
maxq |
numeric <= 1 and larger than minq. upper quantile bound of original value. Ignored if smax is supplied |
smin |
numeric < smax. user supplied lower value for the layers, to be used instead of a quantile computed by the function itself |
smax |
numeric > smin. user supplied upper value for the layers, to be used instead of a quantile computed by the function itself |
samplesize |
numeric > 1. If samplesize < ncell(x), a regular sample of samplesize is taken from x to compute the quantiles (to speed things up) |
filename |
character. Filename for the output Raster object (optional) |
... |
additional arguments as for |
Raster
stretch argument in plotRGB
1 2 3 4 5 |
Loading required package: sp
class : RasterLayer
dimensions : 10, 10, 100 (nrow, ncol, ncell)
resolution : 36, 18 (x, y)
extent : -180, 180, -90, 90 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84
data source : in memory
names : layer
values : 0, 255 (min, max)
class : RasterBrick
dimensions : 10, 10, 100, 2 (nrow, ncol, ncell, nlayers)
resolution : 36, 18 (x, y)
extent : -180, 180, -90, 90 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84
data source : in memory
names : layer.1, layer.2
min values : 0, 0
max values : 255, 255
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.