infer_notation_for_one_label: Infer the notation from one row or column label

View source: R/notation.R

infer_notation_for_one_labelR Documentation

Infer the notation from one row or column label

Description

This is a non-public helper function for vectorized infer_notation().

Usage

infer_notation_for_one_label(
  x,
  inf_notation = TRUE,
  notations = RCLabels::notations_list,
  allow_multiple = FALSE,
  retain_names = FALSE,
  choose_most_specific = TRUE,
  must_succeed = TRUE
)

Arguments

x

A single row or column label.

inf_notation

A boolean that tells whether to infer notation for x.

notations

A list of notations from which matches will be inferred This function might not work as expected if notation is not a list. If notation is not a list, notations is returned in full. Default is RCLabels::notations_list.

allow_multiple

A boolean that tells whether multiple notation matches are allowed. If FALSE (the default), multiple matches give an error.

retain_names

A boolean that tells whether to retain names on the outgoing matches. Default is FALSE. If TRUE, the return value is a named list. If only one of notations is returned, names are never supplied.

choose_most_specific

A boolean that indicates if the most-specific notation will be returned when more than one of notations matches x. Default is TRUE.

must_succeed

A boolean that if TRUE (the default), causes an error to be thrown if a matching notation is not found for any label in x. When FALSE, an unsuccessful label inference will return NULL.

Value

A single matching notation object (if allow_multiple = FALSE, the default) or possibly multiple matching notation objects (if allow_multiple = TRUE). If no notations match x, NULL.


RCLabels documentation built on May 29, 2024, 5:56 a.m.