describe: Formats Summary Tables to Text, LaTeX, and HTML

Description Usage Arguments Value Examples

View source: R/describe.R

Description

Given a dataframe and a list of summary statistics, describe outputs a text table summarizing the data while simultaneously outputting the equivalent LateX code.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
describe(
  data,
  note = "",
  silent = F,
  path = NA,
  max_precision = 6,
  statistics = list(N = length, Mean = mean, `St. Dev` = stats::sd, Min = min, Max =
    max),
  md = NA,
  landscape = FALSE,
  label = "sumStats",
  title = "Summary statistics",
  header = TRUE,
  as_table = FALSE,
  flip = FALSE,
  ...
)

Arguments

data

Dataframe of variables.

note

Optional note displayed at bottom of table.

silent

No text is outputted if true.

path

File path to write tex file.

max_precision

Maximum number of digits in each table cell.

statistics

A list of functions to be applied to each column of the data frame or tibble. Each function must be vectorized.

md

Allows for outputting in either latex ("latex") or html ("html") for markdown formatting. The Markdown chunk must be set to results = "asis".

landscape

If true, the Latex table will be landscaped.

label

Latex label.

title

Table title.

header

Includes RCHITEX header as a Latex comment if true.

as_table

True values wrap the underlying Latex Tabular object in a table.

flip

Invert tables when set to TRUE.

Value

None

Examples

1
2
3
4
5
df <- data.frame("first" = c(4,5,6), "second" = c(7,5,3))
describe(df)

stats <- list(N=length, Average = mean, foo = function(x) x[1]+2)
describe(df, statistics=stats)

bdempe18/rchitex documentation built on Nov. 9, 2020, 11:33 p.m.