md.mean: Print the mean and CIs of a vector

Description Usage Arguments Value Examples

View source: R/core.R

Description

Print the mean and CIs of a vector

Usage

1
2
3
4
5
6
7
8
9
md.mean(
  vector,
  label = "*M*",
  decimals = 2,
  na.rm = F,
  conf.int = 0.95,
  isProportion = F,
  showRange = F
)

Arguments

vector

data in

label

markdown prefix for the stats

decimals

decimal places to round to

na.rm

whether NA values are removed before averaging

conf.int

width of the confidence intervals, NA to suppress

isProportion

whether to print the values as proportions (strip leading 0)

showRange

whether to include the range of the data

Value

string representation of the mean, CIs, and range of the vector

Examples

1
2
3
md.mean(rnorm(1000), label = '*M*|random')
md.mean(rnorm(1000), label = '*M*|random', conf.int = NA) # no longer needs lsr package
md.mean(runif(1000), label = 'Mean probability', isProportion = TRUE, showRange = TRUE)

mjaquiery/prettyMD documentation built on Oct. 6, 2021, 4:16 p.m.