prepare_descriptive_table: Prepares a Table of Descriptive Statistics

Description Usage Arguments Details Value Examples

View source: R/prepapre_descriptive_table.R

Description

Reads a data frame and reports descriptive statistics (n, mean, standard deviation, minimum, first quartile, median, third quartile, maximum) for all members of the data frame that are either numeric or logical.

Usage

1
2
3
4
5
prepare_descriptive_table(
  df,
  digits = c(0, 3, 3, 3, 3, 3, 3, 3),
  format = "html"
)

Arguments

df

Data frame containing at least one variable that is either numeric or logical and at least two observations.

digits

Number of decimal digits that you want to be displayed for each column. If you provide NA, then the column is omitted from the output.

format

character scalar that is handed over to kable (e.g., "html" or "latex").

Details

The digits parameter from prepare_descriptive_table() uses the default method of kable to format numbers, calling round. This implies that trailing zeroes are just omitted.

Value

A list containing two items.

"df"

A data frame containing the descriptive table

"kable_ret"

The return value provided by kable containing the formatted table

Examples

1
2

joachim-gassen/ExPanDaR documentation built on April 15, 2021, 6:07 p.m.