[Experimental]

This helper function adds parentheses around each element of a character vector.

h_parens(x)

Arguments

x

(character)
inputs which should be parenthesized.

Value

Character vector with parentheses, except when x is a blank string in which case it is returned unaltered.

Examples

h_parens("bla")
#> [1] "(bla)"
h_parens("")
#> [1] ""
h_parens(c("bla", "bli"))
#> [1] "(bla)" "(bli)"