plotRVB2: Apply a color gradient to a raster

Description Usage Arguments Value Author(s) Examples

View source: R/plotRVB2.R

Description

This function applies a color gradient to a raster where color is defined by the user.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
plotRVB2(
  x,
  n_classes = NULL,
  breaks = NULL,
  palettes = NULL,
  alpha = 255,
  bgalpha = 0,
  colNA = NA,
  axes = FALSE,
  xlab = "",
  ylab = "",
  add = FALSE
)

Arguments

x

RasterLayer a RasterLayer to plot.

n_classes

... ...

breaks

... ...

palettes

... ...

alpha

integer transparency factor between 0 (transparent) and 255 (opaque).

bgalpha

integer transparency factor for NA values between 0 (transparent) and 255 (opaque).

colNA

string color for the background (i.e. NA values).

axes

boolean If TRUE, axes are added.

xlab

string x-axis label.

ylab

string y-axis label.

add

boolean If TRUE, raster is added the active graphical device.

Value

This function returns a 3-bands raster with the first layer is for the Red, the second for the Green and the third for the Blue. Each non NA cell contains the quantity of a specific color (R, G or B).

Author(s)

Nicolas CASAJUS, nicolas.casajus@fondationbiodiversite.com

Examples

1
2
# No example.
 -------------------------------------------------------------------------   @AddLegendLabel

FRBCesab/ecorar documentation built on June 2, 2021, 8:18 p.m.