Learn R Programming

parameters (version 0.3.0)

format_ci: Confidence/Credible Interval (CI) Formatting

Description

Confidence/Credible Interval (CI) Formatting

Usage

format_ci(CI_low, CI_high, ci = 0.95, digits = 2, brackets = TRUE,
  width = NULL, width_low = width, width_high = width)

Arguments

CI_low

Lower CI bound.

CI_high

Upper CI bound.

ci

CI level in percentage.

digits

Number of significant digits.

brackets

Logical, if TRUE (default), values are encompassed in square brackets.

width

Minimum width of the returned string. If not NULL and width is larger than the string's length, leading whitespaces are added to the string.

width_low, width_high

Like width, but only applies to the lower or higher confidence interval value. This can be used when the values for the lower and upper CI are of very different length.

Value

A formatted string.

Examples

Run this code
# NOT RUN {
format_ci(1.20, 3.57, ci = 0.90)
format_ci(1.20, 3.57, ci = NULL)
format_ci(1.20, 3.57, ci = NULL, brackets = FALSE)
format_ci(c(1.205645, 23.4), c(3.57, -1.35), ci = 0.90)
format_ci(c(1.20, NA, NA), c(3.57, -1.35, NA), ci = 0.90)
# }

Run the code above in your browser using DataLab