g_legend: Create legend

g_legendR Documentation

Create legend

Description

Creates a colorscale legend for a dataset in grob format

Usage

g_legend(
  data,
  data.type = "numeric",
  variable,
  center.zero,
  cols,
  val.limits,
  dark.theme = TRUE
)

Arguments

data

data.frame with values that should be mapped onto colorscale

data.type

input data type, e.g. "factor", "numeric", "character", ...

variable

character string specifying tha name of the column (variable) containing values

center.zero

Specifies whether or not the colorscale should be centered at zero

cols

Character vector with color ids to be used in colorscale

val.limits

Specifies the limits for values in colorscale

dark.theme

Should a dark theme be used?


jbergenstrahle/STUtility documentation built on March 14, 2023, 7:15 a.m.