auto_name: Ensure that all elements of a list of expressions are named

View source: R/utils.R

auto_nameR Documentation

Ensure that all elements of a list of expressions are named

Description

Nearly identical to rlang::exprs_auto_name(), but rlang::as_name() is used instead of rlang::as_label(). For String items the string will returned without wrapping in double quotes. The naming of functions and formulas is not optimal, it is better to manually name theme.

Usage

auto_name(exprs)

Arguments

exprs

A list of expressions.

Value

A named list of expressions

Examples

funs <- list(
  "mean",
  function(x) stats::quantile(x, probs = 0.95),
  ~ stats::quantile(., probs = 0.95),
  q95 = function(x) stats::quantile(x, probs = 0.95)
)

auto_name(funs)

# exprs_autoname adds double quotes to strings
rlang::exprs_auto_name(funs)

Ostluft/rOstluft.plot documentation built on Jan. 26, 2025, 1:05 a.m.