format_interval: Format a posterior median plus credible interval as a single...

View source: R/utils.R

format_intervalR Documentation

Format a posterior median plus credible interval as a single string

Description

Format a posterior median plus credible interval as a single string

Usage

format_interval(median, lower, upper, digits = 2)

Arguments

median, lower, upper

Numeric (scalar or vector).

digits

Integer rounding precision.

Value

Character like "5.12 [4.87, 5.4]". A non-finite median yields NA_character_ (rather than "NA [...]"); a non-finite bound is shown as an en dash, so the strings stay table-ready.

Examples

format_interval(5.123, 4.872, 5.401)
format_interval(NA, 1, 2)   # -> NA

bayesTLS documentation built on Nov. 29, 2026, 1:06 a.m.