% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/summarizor.R
\name{fmt_2stats}
\alias{fmt_2stats}
\alias{fmt_summarizor}
\title{Format summarizor statistics as text}
\usage{
fmt_2stats(stat, num1, num2, cts, pcts, ...)

fmt_summarizor(stat, num1, num2, cts, pcts, ...)
}
\arguments{
\item{stat}{a character column containing the name of statictics}

\item{num1}{a numeric statistic to display such as a mean or a median}

\item{num2}{a numeric statistic to display such as a standard
deviation or a median absolute deviation.}

\item{cts}{a count to display}

\item{pcts}{a percentage to display}

\item{...}{unused arguments}
}
\description{
Format the output of \code{\link[=summarizor]{summarizor()}} into display strings:
quantitative variables are shown as mean (sd), median (IQR), or range;
qualitative variables are shown as count (percentage).
}
\examples{
library(flextable)
z <- summarizor(iris, by = "Species")

tab_1 <- tabulator(
  x = z,
  rows = c("variable", "stat"),
  columns = "Species",
  blah = as_paragraph(
    as_chunk(
      fmt_summarizor(
        stat = stat,
        num1 = value1, num2 = value2,
        cts = cts, pcts = percent
      )
    )
  )
)

ft_1 <- as_flextable(x = tab_1, separate_with = "variable")
ft_1 <- labelizor(
  x = ft_1, j = "stat",
  labels = c(
    mean_sd = "Moyenne (ecart-type)",
    median_iqr = "Mediane (IQR)",
    range = "Etendue",
    missing = "Valeurs manquantes"
  )
)
ft_1 <- autofit(ft_1)
ft_1
}
\seealso{
\code{\link[=summarizor]{summarizor()}}, \code{\link[=tabulator]{tabulator()}}, \code{\link[=mk_par]{mk_par()}}

Other value formatters:
\code{\link[=fmt_avg_dev]{fmt_avg_dev()}},
\code{\link[=fmt_dbl]{fmt_dbl()}},
\code{\link[=fmt_header_n]{fmt_header_n()}},
\code{\link[=fmt_int]{fmt_int()}},
\code{\link[=fmt_n_percent]{fmt_n_percent()}},
\code{\link[=fmt_pct]{fmt_pct()}},
\code{\link[=fmt_signif_after_zeros]{fmt_signif_after_zeros()}}
}
\concept{value formatters}
