Learn R Programming

Desctable


Warning to existing users
This version introduces a new API that should make the creation of tables more flexible.
The old API is still present but in a deprecated mode.
See the roadmap below, and the website for the new usage.
Suggestions about this change are welcome !

Introduction

Desctable aims to be a simple and expressive interface to building statistical tables in R.

See desctable.github.io for usage ond documentation.

Installation

Install from CRAN (0.1.9) with

install.packages("desctable")

or install the development version (0.3) from github with

devtools::install_github("desctable/desctable")

Roadmap

0.3

This new version introduces a new internal representation as well as an entirely new API for desctable !
The original desctable function and usage remains until 1.0, but begins deprecation.

This new API is more flexible and more simple at the same time. Combine group_by, desc_table, desc_tests, and desc_output to create descriptive and comparative statistics tables and output them to various formats.

The internal representation is now a simple dataframe in the simple descriptive case, and a nested dataframe with list-columns for comparative tables, allowing easier manipulation by the user.

Next

  • Add a desc_output for {gt}
  • Implement a way to make tables for survival analysis.
  • Implement a way to make tables for multivariate models.
  • Allow univariate tests for simple tables
  • add a column for totals in grouped tables

Copy Link

Version

Install

install.packages('desctable')

Monthly Downloads

331

Version

0.3.1

License

GPL-3

Maintainer

Maxime Wack

Last Published

August 29th, 2025

Functions in desctable (0.3.1)

pander.desctable

Pander method for desctable
is.normal

Test if distribution is normal
no.test

No test
insert

Insert a vector y inside another vector x at position
head_dataframe

Build the header for dataframe
head_pander

Build the header for pander
flatten_desctable

Flatten a desctable to a dataframe recursively
header

Build header
headerList

build a header list object
set_desctable_class

Set the "desctable" class to the passed object
parse_formula

Parse a formula
stats_auto

Function to create a list of statistics to use in desctable
statTable

Generate the table of all statistics for all variables
testColumn

Create the pvalues column
stats_default

Define a list of default statistics
testify

Transform any test function into a valid test function for the table
tests_auto

Function to choose a statistical test
varColumn

Generate the variable column to display as row names
statColumn

Generate one statistic for all variables
statify

Transform any function into a valid stat function for the table
subTable

Create a subtable in a grouped desctable
subNames

Create the subtables names
percent

Return the percentages for the levels of a factor
reexports

Objects exported from other packages
print.desctable

Print method for desctable
which.desctable

Is the object possibly a desctable?
desc_tests

Add tests to a desc_table
ANOVA

Wrapper for oneway.test(var.equal = T)
IQR

Return the inter-quartile range
desc_table

Generate a statistics table
datatable

Create an HTML table widget using the DataTables library
desc_output

desc_output
chisq.test

Pearson's Chi-squared Test for Count Data
fisher.test

Fisher's Exact Test for Count Data
as.data.frame.desctable

As.data.frame method for desctable
desctable

Generate a statistics table
head_datatable

Build the header for datatable