Learn R Programming

vibass (version 1.0.1)

summary_table: Print a standardised summary table

Description

Make a table of several summary statistics with proper formatting.

Usage

summary_table(
  mean,
  var,
  quant,
  ic95 = NULL,
  prop0 = NULL,
  prop1 = NULL,
  label,
  digits = 2,
  ...
)

Value

A knitr_kable object.

Arguments

mean

Real.

var

Real.

quant

Named numeric vector. Names must be of the form "xx numeric xx. As from the output of the function quantile.

ic95

Numeric vector.

prop0

Real.

prop1

Real.

label

Character. Name of the summarised variable.

digits

Integer. Number of decimal places to be used.

...

Passed to knitr::kable().

Details

The table includes the mean, variance and standard deviation, a vector of 3 quantiles at 0.05, 0.50 and 0.95, a 95 numeric value to be interpreted as a proportion above 0 and 1. All values are rounded to the specified number of decimal places.

Examples

Run this code
summary_table(mean = 1, var = 1, quant = quantile(1:10, 0:4/4), ic95 = 4:5,
prop1 = .6, label = "test")

Run the code above in your browser using DataLab