generate_varlabel: Generate label for maps and plots

View source: R/generate_varlabel.R

generate_varlabelR Documentation

Generate label for maps and plots

Description

Create a label containing the variable name and unit and optional additional information to be used in maps and plots.

Usage

generate_varlabel(
  x = NULL,
  variable = NULL,
  unit = NULL,
  method = NULL,
  period = NULL,
  verbose = FALSE
)

Arguments

x

The object to be plotted. If x is provided and the variable and unit names are not explicitly stated, this information is extracted from the attributes of x.

unit

Unit name. If provided, unit is used rather than the attr(x, 'unit')

method

Method. If provided, this information is added to the label

period

Time period. If provided, this information is added to the label

verbose

If TRUE, print information about the progress

variabel

Variable name. If provided, variable is used rather than the attr(x, 'variable')

Value

An expression to be used as a label in maps and plots

Examples


data(bjornholt)
label <- generate_varlabel(bjornholt)
print(label)


metno/esd documentation built on Feb. 25, 2025, 6:44 p.m.