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

271

Version

0.3.0

License

GPL-3

Maintainer

Maxime Wack

Last Published

March 24th, 2022

Functions in desctable (0.3.0)

IQR

Return the inter-quartile range
as.data.frame.desctable

As.data.frame method for desctable
desc_table

Generate a statistics table
ANOVA

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

desc_output
desc_tests

Add tests to a desc_table
chisq.test

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

Fisher's Exact Test for Count Data
desctable

Generate a statistics table
datatable

Create an HTML table widget using the DataTables library
header

Build header
set_desctable_class

Set the "desctable" class to the passed object
head_datatable

Build the header for datatable
no.test

No test
testColumn

Create the pvalues column
is.normal

Test if distribution is normal
insert

Insert a vector y inside another vector x at position
reexports

Objects exported from other packages
print.desctable

Print method for desctable
pander.desctable

Pander method for desctable
testify

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

Function to choose a statistical test
statColumn

Generate one statistic for all variables
flatten_desctable

Flatten a desctable to a dataframe recursively
head_dataframe

Build the header for dataframe
headerList

build a header list object
varColumn

Generate the variable column to display as row names
subTable

Create a subtable in a grouped desctable
percent

Return the percentages for the levels of a factor
parse_formula

Parse a formula
subNames

Create the subtables names
stats_auto

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

Define a list of default statistics
which.desctable

Is the object possibly a desctable?
statTable

Generate the table of all statistics for all variables
statify

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

Build the header for pander