plotRGB: Red-Green-Blue plot of a multi-layered Raster object
Description
Make a Red-Green-Blue plot based on three layers (in a RasterBrick or RasterStack). Three layers (bands) are combined such that one is the red channel, one is the green channel, and one is the blue channel. This function could be used to make 'True (or false) color images' from Landsat and other multi-band satellite images.
Usage
## S3 method for class 'RasterStackBrick':
plotRGB(x, r=1, g=2, b=3, scale, maxpixels=500000, stretch=NULL, ext=NULL, interpolate=FALSE, bgcol='white', alpha, bgalpha, ...)
Arguments
x
RasterBrick or RasterStack
r
Integer. Index of the Red channel, between 1 and nlayers(x)
g
Integer. Index of the Green channel, between 1 and nlayers(x)
b
Integer. Index of the Blue channel, between 1 and nlayers(x)
scale
Integer. Maximum (possible) value in the three channels. Defaults to 255 or to the maximum value of x if that is known and larger than 255
maxpixels
Maximum number of pixels to use
stretch
Option to stretch the values to increase the contrast of the image: "lin" or "hist"
ext
An Extent object to zoom in to a region of interest (see drawExtent
interpolate
interpolate the image when drawing
bgcol
Background (NA) color. Default is 'white'
alpha
transparancy. Integer between 0 (transparant) and 255 (opaque)
bgalpha
Background transparancy. Integer between 0 (transparant) and 255 (opaque)