ensure_parens: Add parens if not found

View source: R/utils.R

ensure_parensR Documentation

Add parens if not found

Description

Opening and closing parens will be added if an opening paren is not the first non-whitespace character.

Usage

ensure_parens(x)

Arguments

x

a list or vector

Value

x is returned, possibly modified with parens added.

Examples

ensure_parens(letters[1:4])

ensure_parens(as.list(letters[1:4]))

ensure_parens(c("(a)", "b", "(c)"))


metrumresearchgroup/pmtables documentation built on Oct. 27, 2024, 5:16 p.m.