remove_label_pieces {RCLabels} | R 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 |
prepositions |
A list of prepositions, used to detect prepositional phrases.
Default is |
inf_notation |
A boolean that tells whether to infer notation for |
notation |
The notation type to be used when extracting prepositions.
Default is |
choose_most_specific |
A boolean that tells whether the most specific
notation is selected when more than one notation match.
Default is |
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"))