parens-extractors: Extract substrings from before and inside parentheses
Description
before_parens() and inside_parens() extract substrings from
before or inside parentheses, or similar separators like brackets or curly
braces.
See split_by_parens() to split some or all columns in a data frame into
both parts.
Usage
before_parens(string, sep = "parens")
inside_parens(string, sep = "parens")
Value
String vector of the same length as string. The part of string
before or inside sep, respectively.
Arguments
string
Vector of strings with parentheses or similar.
sep
String. What to split by. Either "parens", "brackets",
"braces", or a length-2 vector of custom separators. See examples for
split_by_parens(). Default is "parens".