custom.summarize: Output summary table split by a categorical variable

View source: R/knitr_utils.R

custom.summarizeR Documentation

Output summary table split by a categorical variable

Description

Output summary table split by a categorical variable

Usage

custom.summarize(
  df,
  vars,
  facvar = NULL,
  statscol = T,
  test_type = "wilcox",
  sig.digits = 2
)

Arguments

df

data frame

vars

Named vector. Names are variables to summarize, values are human readable versions.

facvar

Factor variable defining exactly two groups.

statscol

Include statistical test of location difference between two groups.

sig.digits

The number of signficant digits for the output.

Value

A data frame with the summary stats that can be printed with kable

Examples

data(mtcars)
vars = c(mpg = 'miles per gallon', hp = 'horse power')
custom.summarize(mtcars, vars, facvar='am')

grasshoppermouse/hagenutils documentation built on Dec. 6, 2024, 8:31 p.m.