output-formatting: Results formatting for tables and reports

output-formattingR Documentation

Results formatting for tables and reports

Description

These functions are simple wrappers around paste and nmbr to format results for printing.

Usage

mean_sd(mean, sd, prefix = "", suffix = "", ..., format_paren = TRUE)

n_percent(
  n,
  proportion,
  accuracy = 1,
  scale = 1,
  prefix = "",
  suffix = "",
  percent = "%",
  ...,
  format_paren = TRUE
)

est_ci(
  est,
  low,
  high,
  p,
  prefix = "",
  suffix = "",
  ...,
  .sep = " to ",
  format_paren = TRUE,
  stars = TRUE,
  levels = c(`*` = 0.1, `**` = 0.05, `***` = 0.01),
  accuracy_p = 1e-04,
  min_p = accuracy_p,
  add_p = TRUE
)

coef_se(
  coef,
  se,
  p,
  prefix = "",
  suffix = "",
  ...,
  stars = TRUE,
  levels = c(`*` = 0.1, `**` = 0.05, `***` = 0.01),
  accuracy_p = 1e-04,
  min_p = accuracy_p,
  add_p = TRUE
)

Arguments

mean, sd, n, proportion, est, low, high, coef, se, p

Numeric vectors. If proportion is missing, it will be calculated as n / sum(n). If p is provided for est_ci() and coef_se(), p-values (if stars = FALSE) or significance stars (if stars = TRUE) will be printed after the coefficient and standard error/confidence interval.

format_paren

Logical scalar. Should the values inside parentheses include the specified prefix and suffix formatters?

accuracy, scale, prefix, suffix, percent, ...

Passed to nmbr and prct.

.sep

Separator between lower and upper bounds of the CI; default is ' to '.

stars

Logical scalar. Should significance stars (TRUE) or p-values (FALSE) be printed after confidence intervals or standard errors (only used when p is provided).

levels

Passed to stars.

accuracy_p, min_p, add_p

Passed to pval (accuracy_p as the accuracy argument of pval()).


uo-cmor/formattr documentation built on Sept. 13, 2023, 10:46 p.m.