Description Usage Arguments Value Note See Also Examples
Parenthesise a character vector by wrapping elements in brackets, dashes or commas.
1 2 3 4 5 6 7 8 9 10 11 | parenthesize(
x,
type = c("round_brackets", "square_brackets", "curly_brackets", "angle_brackets",
"chevrons", "hyphens", "en_dashes", "em_dashes", "commas")
)
parenthesise(
x,
type = c("round_brackets", "square_brackets", "curly_brackets", "angle_brackets",
"chevrons", "hyphens", "en_dashes", "em_dashes", "commas")
)
|
x |
Character vector to wrap in parenthenses. |
type |
String naming the type of parenthesis. |
A character vector of the input wrapped in parentheses.
English grammar terminology is awfully confusing. The verb 'to parenthesise' means to wrap a phrase in brackets or dashes or commas, thus denoting it as supplementary material that could be left out. A 'parenthesis' as a noun is often used as a synonym for a round bracket.
1 2 3 4 5 6 7 8 9 10 11 12 | paste("There were three", parenthesise(3), "mice in the experiment.")
paste(
"I love parmos",
parenthesise("Teesside's finest culinary invention", "en_dashes"),
"but they are sure to give me heart disease."
)
parenthesise(letters[1:5], "curly")
paste0(
"The R language",
parenthesise("an offshoot of S and Scheme", "commas"),
"is quite good for data analysis."
)
|
[1] "There were three (3) mice in the experiment."
Warning message:
Coercing 3 to class 'character'.
[1] "I love parmos <U+2013> Teesside's finest culinary invention <U+2013> but they are sure to give me heart disease."
[1] "{a}" "{b}" "{c}" "{d}" "{e}"
[1] "The R language, an offshoot of S and Scheme, is quite good for data analysis."
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.