File: RGB.Rd

package info (click to toggle)
r-cran-raster 3.6-31-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 3,300 kB
  • sloc: cpp: 2,367; ansic: 1,572; sh: 13; makefile: 2
file content (50 lines) | stat: -rw-r--r-- 1,800 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
\name{RGB}

\docType{methods}

\alias{RGB}
\alias{RGB,RasterLayer-method}

\title{Create a Red-Green-Blue Raster object}

\description{
Make a Red-Green-Blue object that can be used to create images. 
}


\usage{
\S4method{RGB}{RasterLayer}(x, filename='', col=rainbow(25), breaks=NULL, alpha=FALSE, 
		colNA='white', zlim=NULL, zlimcol=NULL, ext=NULL, ...)
}


\value{RasterBrick}



\arguments{
  \item{x}{RasterLayer}
  \item{filename}{character. Output filename (optional)}
  \item{col}{A color palette, that is a vector of n contiguous colors generated by functions like \link{rainbow}, \link{heat.colors}, \link{topo.colors}, \link[sp]{bpy.colors} or one or your own making, perhaps using \code{\link{colorRampPalette}}. If none is provided, \code{rev(terrain.colors(255))} is used unless \code{x} has a 'color table'}
  \item{breaks}{numeric. A set of finite numeric breakpoints for the colours: must have one more breakpoint than colour and be in increasing order}  
  \item{alpha}{If \code{TRUE} a fourth layer to set the background transparency is added}
  \item{colNA}{color for the background (\code{NA} values)}
  \item{zlim}{vector of lenght 2. Range of values to plot}
  \item{zlimcol}{If \code{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 \code{NA} values (see colNA)}
  \item{ext}{An \code{\link{Extent}} object to zoom in to a region of interest (see \code{\link{drawExtent}})}
  \item{...}{additional arguments as for \code{\link{writeRaster}}}
}


\seealso{ \code{\link[raster]{plotRGB}} }

\examples{
r <- raster(system.file("external/test.grd", package="raster"))
x <- RGB(r)
plot(x, col=gray(0:9/10))
plotRGB(x)
}

\keyword{methods}
\keyword{spatial}