remove_label_pieces: Remove a prepositional phrase in a row or column label

View source: R/setters.R

remove_label_piecesR Documentation

Remove a prepositional phrase in a row or column label

Description

This function removes pieces from row and column labels.

Usage

remove_label_pieces(
  labels,
  pieces_to_remove,
  prepositions = RCLabels::prepositions_list,
  inf_notation = TRUE,
  notation = RCLabels::notations_list,
  choose_most_specific = FALSE
)

Arguments

labels

The row and column labels from which prepositional phrases will be removed.

pieces_to_remove

The names of pieces of the label to be removed, typically "noun" or a preposition such as "of" or "in" See RCLabels::prepositions_list for a list of known prepositions.

prepositions

A list of prepositions, used to detect prepositional phrases. Default is RCLabels::prepositions_list.

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 prepositions. Default is RCLabels::notations_list, meaning that the notation is inferred using infer_notation().

choose_most_specific

A boolean that tells whether the most specific notation is selected when more than one notation match. Default is FALSE.

Value

labels with pieces removed.

Examples

labs <- c("a [of b in c]", "d [-> e in f]")
remove_label_pieces(labs, pieces_to_remove = "of")
remove_label_pieces(labs, pieces_to_remove = c("of", "->"))
remove_label_pieces(labs, pieces_to_remove = c("in", "into"))
remove_label_pieces(labs, pieces_to_remove = c("of", "in"))

RCLabels documentation built on April 25, 2023, 5:11 p.m.