matchLayerCols: Make a LAyer colour list

View source: R/plotting-framework-functions.R

matchLayerColsR Documentation

Make a LAyer colour list

Description

This is a helper function for when plotting Layers by colour. It takes a list of Layer ids (other things like "Total" or "Tree" can also be specified) and returns a list of colours with the names of the Layer (which is how ggplot likes colours to be specified).

Usage

matchLayerCols(
  values,
  layers,
  others = list(Total = "black", None = "grey75", Tree = "brown", Grass = "green", Shrub
    = "red")
)

Arguments

values

List of values (as chararacters) for which you want standard colours.

layers

A list of Layer objects (which should contain Layers with ids provided in 'values)

others

A list of other name-colour combinations, for example to plot 'Total' as black, "None" as grey, or whatever. Some defaults are defined.

Value

Returns a named list of colours, where the names are the values that the colours will represent

Author(s)

Matthew Forrest matthew.forrest@senckenberg.de


MagicForrest/DGVMTools documentation built on Aug. 23, 2024, 8:05 a.m.