Learn R Programming

SpaDES (version 1.2.0)

.makeColorMatrix: Convert Raster to color matrix useable by raster function for plotting

Description

Internal function.

Usage

.makeColorMatrix(grobToPlot, zoomExtent, maxpixels, legendRange, cols = NULL, na.color = "#FFFFFF00", zero.color = NULL, skipSample = TRUE)
".makeColorMatrix"(grobToPlot, zoomExtent, maxpixels, legendRange, cols = NULL, na.color = "#FFFFFF00", zero.color = NULL, skipSample = TRUE)

Arguments

grobToPlot
A SpatialObject.
zoomExtent
An Extent object for zooming to. Defaults to whole extent of grobToPlot.
maxpixels
Numeric. Number of cells to subsample the complete grobToPlot.
legendRange
Numeric vector giving values that, representing the lower and upper bounds of a legend (i.e., 1:10 or c(1,10) will give same result) that will override the data bounds contained within the grobToPlot.
cols
Colours specified in a way that can be understood directly or by colorRampPalette.
na.color
Character string indicating the color for NA values. Default transparent.
zero.color
Character string indicating the color for zero values, when zero is the minimum value. Otherwise, it is treated as any other color. Default transparent. Use NULL if zero should be the value given to it by the colortable associated with the Raster.
skipSample
Logical. If no downsampling is necessary, skip. Default TRUE.