paren: Add or Remove Parentheses

View source: R/utiltext.R

parenR Documentation

Add or Remove Parentheses

Description

Add or remove enclosing parentheses around a string.

Usage

paren(x, type = "(")
unparen(x)

Arguments

x

A character string, or vector of character strings.

type

Type of parentheses: either "(", "[" or "{".

Details

paren(x) adds enclosing parentheses to the beginning and end of the string x.

unparen(x) removes enclosing parentheses if they are present.

Value

A character string, or vector of character strings of the same length as x.

Author(s)

\adrian

.

See Also

commasep

Examples

  paren("Hello world")
  paren(42, "[")
  paren(letters[1:10])
  unparen(c("(yes)", "[no]", "{42}"))

spatstat/spatstat.utils documentation built on Aug. 18, 2024, 2:39 p.m.