RGB: Create a Red-Green-Blue Raster object

Description Usage Arguments Value See Also Examples

Description

Make a Red-Green-Blue object that can be used to create images.

Usage

1
2
3
## S4 method for signature 'RasterLayer'
RGB(x, filename='', col=rainbow(25), breaks=NULL, alpha=FALSE, 
		colNA='white', zlim=NULL, zlimcol=NULL, ext=NULL, ...)

Arguments

x

RasterLayer

filename

character. Output filename (optional)

col

A color palette, that is a vector of n contiguous colors generated by functions like rainbow, heat.colors, topo.colors, bpy.colors or one or your own making, perhaps using colorRampPalette. If none is provided, rev(terrain.colors(255)) is used unless x has a 'color table'

breaks

numeric. A set of finite numeric breakpoints for the colours: must have one more breakpoint than colour and be in increasing order

alpha

If TRUE a fourth layer to set the background transparency is added

colNA

color for the background (NA values)

zlim

vector of lenght 2. Range of values to plot

zlimcol

If NULL the values outside the range of zlim get the color of the extremes of the range. If zlimcol has any other value, the values outside the zlim range get the color of NA values (see colNA)

ext

An Extent object to zoom in to a region of interest (see drawExtent)

...

additional arguments as for writeRaster

Value

RasterBrick

See Also

plotRGB

Examples

1
2
3
4
r <- raster(system.file("external/test.grd", package="raster"))
x <- RGB(r)
plot(x, col=gray(0:9/10))
plotRGB(x)

Example output

Loading required package: sp

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