get_nouns: Extract nouns from row and column labels

View source: R/extractors.R

get_nounsR Documentation

Extract nouns from row and column labels

Description

Nouns are the first part of a row-column label, "a" in "a [b]". Internally, this function calls get_pref_suff(which = "pref").

Usage

get_nouns(
  labels,
  inf_notation = TRUE,
  notation = RCLabels::notations_list,
  choose_most_specific = TRUE
)

Arguments

labels

A list or vector of labels from which nouns are to be extracted.

inf_notation

A boolean that tells whether to infer notation for x. Default is TRUE. See infer_notation() for details.

notation

The notation type to be used when extracting nouns. Default is RCLabels::notations_list, meaning that the notation is inferred using infer_notation().

choose_most_specific

A boolean that tells whether to choose the most specific notation from notation when inferring notation. Default is TRUE.

Value

A list of nouns from row and column labels.

Examples

get_nouns("a [b]", notation = bracket_notation)
# Also works with vectors and lists.
get_nouns(c("a [b]", "c [d]"))
get_nouns(list("a [b]", "c [d]"))

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