fmt_est: Format model estimator

View source: R/fmt.R

fmt_estR Documentation

Format model estimator

Description

Formats mean sd/se to a format as x.x or x.x (x.xx) if both mean and sd/sd are defined.

Usage

fmt_est(
  mean,
  sd = rep(NA, length(mean)),
  digits = c(1, 1),
  width = c(4, 3) + digits
)

Arguments

mean

A numeric vector of mean value.

sd

A numeric vector of standard deviation value.

digits

Digits of each column, i.e., format as x.x (x.xx).

width

Width of each column.

Details

The function assumes 1 column or 2 columns:

  • If there is only 1 column, only represent mean.

  • If there are 2 columns, represent mean (sd) or mean(se). Decimals will understand the number will be formatted as x.x (x.xx).

Value

The same data frame with additional attributes for page features.

Specification

The contents of this section are shown in PDF user manual only.

Examples

fmt_est(mean(iris$Petal.Length), sd(iris$Petal.Length))
fmt_est(mean(iris$Petal.Length), sd(iris$Petal.Length), digits = c(2, 3))

Merck/metalite.ae documentation built on Feb. 10, 2025, 5:03 p.m.