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,
  notation = RCLabels::bracket_notation
)

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 for a list of known prepositions.

prepositions

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

notation

The notation used in labels. Default is RCLabels::bracket_notation.

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 March 18, 2022, 7:19 p.m.