Learn R Programming

metalite.ae (version 0.1.2)

fmt_est: 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
)

Value

The same data frame with additional attributes for page features.

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.

Specification

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

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).

Examples

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

Run the code above in your browser using DataLab