Formula-Driven Table Generation

Computes and displays complex tables of summary statistics. Output may be in LaTeX, HTML, plain text, or an R matrix for further processing.


0.0: Various abortive attempts

0.1: First alpha version with Hmisc support

0.2: First reasonably complete release

0.3: Renamed from "tabular" to "tables", put on R-forge

0.4: Added All(), Literal() and RowFactor() Added table_options() and booktabs() for booktabs support Gave different defaults for row label justification and data justification Suppress page breaks in RowFactor(). Allow options to be set temporarily in latex() call. Added options to suppress parts of the output.

0.5: Planned CRAN release of all of the above

0.6: Fixed bug in column headings in print.tabular (reported by Tal Galili) Added Factor(). Fixed bug with zero columns of row labels. Added levelnames argument to RowFactor and Factor to allow label customization. Added Multicolumn function. Added as.matrix(), write.csv.tabular() and write.table.tabular() (suggestions of Greg Snow). Added LaTeX escapes to text in the body or labels constructed by All() or the factor labels. (Suggestion of Dieter Menne.) Added a caption to the longtable example. (Suggestion of Dieter Menne.) Added the version number to the vignette title page. Fixed RowFactor to add space before first row, not after last row. (Bug report from Dieter Menne.) Made tabular() into a generic function. (Suggestion of Hadley Wickham.) Added description of missing values to the vignette. Fixed handling of data with an Hmisc "labelled" class attached. (Reported by Thomas MacFarland.)

0.7: RowFactor now allows spacing=1. Specifications for justification in table_options() are now recycled. Missing values were not handled correctly when computing counts, and when working with factors. (Reported by Manuel Reif.) Added Percent() pseudo-function. Cleaned up handling of row and column labels, especially in cases where rows with different column headings are summed. Added optional parameter to Heading() to use it only if another hasn't already been set.

0.7.48: Default formatting now skips character cells. Justification of labels in text mode wasn't being done properly.

0.7.64: Added support for HTML output. Added support for extraction of subsets of the matrix. Added Paste() function. If a summary doesn't produce a scalar value, formatting messed up the display. Now a warning will be issued and that cell will be displayed as or similar. Added cbind() and rbind() methods for tabular objects. The internal texify() function did not work properly.

0.7.67: The cbind() and rbind() methods now allow NULL in the list of arguments. (Suggestion of Jeff Newmiller.) Added a note in the vignette about how to use RowFactor with nopagebreak in a longtable environment. (Based on some sleuthing by Jeffrey Miller.) Added HTMLcaption to the table options to insert an HTML caption. (Suggestion of Joseph Larmarange.)

0.7.68: Bug fix in setting up column headings (reported by Lars Bishop).

0.7.79: Added Equal() and Unequal() pseudo-functions for more flexible Percent() calculations. Fixed bug in handling factors which had not excluded NA values. Added "formula" attribute to tabular.formula results. Added as.tabular() function. Added Arguments() function to allow multi-argument analysis functions.

0.7.86: Fixed scoping bug: locally defined format functions were not always found. (Reported by Doug Ezra Morrison.)

0.7.87: Added "append" argument to latex.tabular() and html.tabular(), and made explicit that connections are allowed for the "file" argument. (Suggestion of Marc Halperin.)

0.7.88: Edited messages to allow internationalization. No translations added so far.

0.7.91: Updated options for html.tabular to use better CSS and HTML5 in the tables. Added an HTML vignette. Fixed bug: functions prefixed by "pkg::" in formulas led to warning messages. (Reported by Lars Bishop.)

0.8: Allow editing of the row and column labels. Added DropEmpty() pseudo-function. Added AllObs() and RowNum() formula functions. Added character.only argument to Heading() and Paste().

0.8.4: Added check for bad args to DropEmpty(), and fixed example which had them. Added "nearData" argument to Heading() etc, to fix Hline() bug reported by Johannes Ranke. Fixed bug in justification of row labels. Fixed bug when statistic had the wrong length, reported by Stefan Marr. Added toKable() function, for use with the kableExtra package. Added knit_print.tabular() method, so that tabular objects will print with correct formatting in knitr documents.

0.8.7: Added ... argument to toKable() so that options can be passed to control the conversion. (Thanks to Mary Putt for pointing out the need for this.) Fixed bug in that failed if any columns were factors. (Reported by Daniel Farewell.) Fixed incompatibility with new version of fancyvrb.
(Thanks to Prof. Brian Ripley for working out the solution.) Fixed incompatibility with rmarkdown/knitr new version.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.9.6 by Duncan Murdoch, a year ago

Report a bug at

Browse source code at

Authors: Duncan Murdoch

Documentation:   PDF Manual  

Task views: Reproducible Research

GPL-2 license

Imports stats, utils, knitr, htmltools

Suggests magrittr, kableExtra, Hmisc, bookdown, rmarkdown

System requirements: pandoc (>= 1.12.3) for vignettes

Imported by MRCV, modelsummary, tablesgg.

Depended on by uplift.

Suggested by Hmisc, pander, rockchalk.

See at CRAN