powered by
Add or remove enclosing parentheses around a string.
paren(x, type = "(") unparen(x)
A character string, or vector of character strings of the same length as x.
x
A character string, or vector of character strings.
Type of parentheses: either "(", "[" or "{".
"("
"["
"{"
Adrian Baddeley Adrian.Baddeley@curtin.edu.au.
paren(x) adds enclosing parentheses to the beginning and end of the string x.
paren(x)
unparen(x) removes enclosing parentheses if they are present.
unparen(x)
commasep
paren("Hello world") paren(42, "[") paren(letters[1:10]) unparen(c("(yes)", "[no]", "{42}"))
Run the code above in your browser using DataLab