Skip to contents

This function proposes a convenient wrapper to create a measure set, mimicking a behaviour of metric_set.

Usage

measure_set(...)

Arguments

...

The bare names of the functions to be included in the measure set.

Details

All functions must be valid measure functions, i.e. they must be of class tendency_measure, var_measure or sym_measure. Or created with new_tendency_measure, new_var_measure or new_sym_measure.

Alike with metric_set, where it is not allowed to mix different metric classes, it is allowed to mix different measure classes in measure_set. For example, gm() can be used with cv() because they are valid measure functions even though first one is of class tendency_measure and the second one is of class var_measure.

See also

Other descriptive statistics: cv(), gm()

Examples

if (FALSE) { # \dontrun{
library(tidyhydro)

# Multiple descriptive statistics
multi_measure <- measure_set(gm, cv)

# The returned function has arguments:
# fn(data, truth, na_rm = TRUE, ...)
multi_measure(avacha, obs)

avacha |>
  group_by(month = format(date, "%b")) |>
  multi_measure(obs)
} # }