formatCI: Pretty formatting of confidence intervals

Description Usage Arguments Value Author(s) See Also Examples

View source: R/formatCI.R

Description

Pretty much does what the title says.

Usage

1
2
3
formatCI(ci, sep = "; ",
         prefix = "[", suffix = "]",
         digits = 2, noZero = FALSE)

Arguments

ci

A confidence interval (a vector of 2 elements; longer vectors work, but I guess that wouldn't make sense).

sep

The separator of the values, usually "; " or ", ".

prefix

The prefix, usually a type of opening parenthesis/bracket.

suffix

The suffix, usually a type of closing parenthesis/bracket.

digits

The number of digits to which to round the values.

noZero

Whether to strip the leading zero (before the decimal point), as is typically done when following APA style and displaying correlations, p values, and other numbers that cannot reach 1 or more.

Value

A character vector of one element.

Author(s)

Gjalt-Jorn Peters

Maintainer: Gjalt-Jorn Peters <[email protected]>

See Also

noZero, formatR, formatPvalue

Examples

1
2
3
4
5
### With leading zero ...
formatCI(c(0.55, 0.021));

### ... and without
formatCI(c(0.55, 0.021), noZero=TRUE);

userfriendlyscience documentation built on May 2, 2018, 5:06 p.m.