psthr: Round and paste with parentheses (smart formatting)

View source: R/helper.R

psthrR Documentation

Round and paste with parentheses (smart formatting)

Description

Rounds numeric values and formats as "value (lower, upper)" with intelligent formatting:

  • Values with |x| < 0.01 or |x| > 1000: scientific notation

  • Other values: standard rounding with trailing zeros

Usage

psthr(x, y = 2, compact = FALSE)

psthr0(x, digits = 2)

Arguments

x

Numeric vector to round and format

y

Number of digits/significant figures (default 2)

compact

If TRUE, omit spaces for compact display (e.g. plots)

Value

Character string with first element followed by remaining elements in parentheses

Functions

  • psthr0(): Compact version without spaces (for plots)


reportRmd documentation built on March 20, 2026, 5:06 p.m.