Create 'Table 1' to Describe Baseline Characteristics with or without Propensity Score Weights

Creates 'Table 1', i.e., description of baseline patient characteristics, which is essential in every medical research. Supports both continuous and categorical variables, as well as p-values and standardized mean differences. Weighted data are supported via the 'survey' package.


tableone 0.10.0 (2019-02-16)


  • Fix a missing value handling issue (via @chipmanj). Closes issue #26.

  • mean (sd) was changed to mean (SD) to be consistent with median [IQR].


  • Add a helper for exporting TableOne objects to Markdown (via @malcolmbarrett). Currently, this is very basic. We hope to extend its functionalities.

  • now lists similar or complementary projects.

tableone 0.9.3 (2018-04-28)


  • Fix incompatibility with lmerTest package (via @runehaubo).
  • Suppressed "No sampling weights provided" warning on svrepdesign.

tableone 0.9.2 (2018-01-24)


  • Address CRAN test issues on some platforms.
  • Fix typos (via @LucyMcGowan)

tableone 0.9.1 (2017-11-06)


  • ExtractSmd always returns a matrix even when there are only two groups for easier subsequent data manipulation.

tableone 0.9.0 (2017-11-03)


  • The "varLabels" option for the print.TableOne method was added. When TRUE, instead of printing the variable names, their corresponding variable labels are used. Variable labels must be stored in the data frame to be used via labelled::var_label function. This option is also available in ExtractSmd function.

  • The "dropEqual" option for the print methods was implemented. If TRUE, the level description for two-level variables such as " = 1" and " = TRUE" are not shown. This can obscure what level is being shown depending on the variable naming scheme, thus, should only be used after the initial results were checked for correctness.


  • Handling of lme4 models was improved in ShowRegTable.

tableone 0.8.2 (2017-08-31)


  • Handle labelled class as categorical.

tableone 0.8.1 (2017-06-17)


  • Fix alignment issue with the Missing column. Note currently the percentage is shown with 1 decimal and this is hard-coded.

  • Change vignetteBuilder to knitr to form the index correctly.

  • Single-quote package names in DESCRIPTION.

tableone 0.8.0 (2017-06-15)


  • The "missing" option for the print methods was implemented. If TRUE, a column called "Missing" is added as the rightmost column of the formatted table. This represents percentage of missing observation in each variable. Please note this is the percentage with respect to the unweighted raw observations even in weighted tables.

  • The "padColnames" option was added the print.TableOne method. If TRUE, the column names of the formatted table become space-padded to center them.

tableone 0.7.6 (2016-07-12)


  • The explanation for the "factorVars" argument for the functions CreateTableOne and svyCreateTableOne were changed for clarity. When factor variables are included in the argument, they are releveled to exlude empty levels. This was not clearly documented in the previous documentation. Thanks @eribul.

  • objects (survey design objects with replicate weights) are allowed for the data argument in svyTableOne. This is considered experimental. Thanks @przemo.

tableone 0.7.5 (2016-04-10)


  • ShowRegTable() now correctly supports models fit with geepack, nlme, and lme4.

tableone 0.7.4 (2016-03-31)


  • Define SMD := 0 when the numerator is 0 even if the denominator is also 0. This is more intuitive because a constant compared across two groups will give an SMD of 0 rather than NaN (0/0). For example, if two groups being compared both only have one gender (all female or all male), then SMD for the gender variable is defined as 0.

tableone 0.7.3 (2015-11-10)


  • Fix the vignette for upcoming ggplot2 update.

tableone 0.7.2 (2015-10-25)


  • Solve errors with abnormal pooled variance-covariance matrices in standardized mean difference calculation.

tableone 0.7.1 (2015-08-11)


  • Solve problems with unit testing on the sparc architecture without extended-precision arithmetic support.

  • Fix title for second vignette.

tableone 0.7.0 (2015-08-10)


  • Weighted data are now supported via the survey package. svydesign() should be used to create a survey design object, and this object should be used for svyCreateTableOne() instead of a data frame. Other options are essentially the same. All results will be weighted results.

  • Standardized mean differences are calculated. print() methods include smd option, which defaults to FALSE for backward compatibility. If TRUE, SMD is shown on the right side of the table. To suppress p-values, use test = FALSE option. summary() methods also print SMDs. If there are more than two strata, all possible pairwise contrasts are shown along with the average SMD across all contrats. In this case, print methods only prints the average SMD for brevity. For categorical variables Yang and Dalton's suggested method (A unified approach to measuring the effect size between two groups using SAS. SAS Paper 335-2012) is used. SMDs for weighted data are experimental.

  • ExtractSmd() function can be used to extract SMD values as a numeric matrix, which then can be used for plotting, etc.

  • An new RMarkdown vignette explains the use of standardized mean differences.

  • The includeNA option for CreateTableOne() and svyCreateTableOne() make NA's in factors treated as a regular level.

  • ShowRegTable() now has ciFun option, which allows use of the confint.default function if calculation is too slow for glm results.

  • print.TableOne() aligns the sample size with other summaries.


  • ShowRegTable() uses coef to refer to coefficients.

  • Unit tests were extended to cover more functions.

  • CreateTableOne() was refactored to avoid redundant calculation.

  • New dependencies: survey, MASS, and zoo


  • Fixed pDigits option in print.ContTable(), which was not correctly functional as advertised.

tableone 0.6.3 (2014-12-28)


  • An RMarkdown vignette outlining the use of the package was added.

tableone 0.6.2 (2014-06-01)


  • The testing of 1 x m table was problematic when a categorical variable only have one level. chisq.test() returns Chi-squared test for given probabilities (test for strata imbalance) in such cases. In this version, testing a 1 x m table always return NA, as test for a cross table is not defined in this context.

  • Special thanks to Atsushi Shiraishi for reporting this issues.

  • Unit testing with the testthat package was added for some functions. Thus, the testthat package was added as a suggested package.

tableone 0.6.1 (2014-06-01)


  • The algorithm CreateCatTable used to detect variables to convert to factos had a bug. CreateCatTable was effectively (re-)converting all variables to factors, which deleted empty levels from factors and ordered factors.

  • Special thanks to Atsushi Shiraishi for reporting this issues.

tableone 0.6.0 (2014-05-31)


  • The CreateTableOne function automatically use all variables in the data frame given to the data argument, if the vars argument is empty.
  • The printToggle argument added to ShowRegTable().

tableone 0.5.0 (2014-04-14)


  • The noSpaces argument was added to print.* functions. This allows removal of spaces added for alignment using fixed-width fonts. Use this option if you prefer to align your table in other software. (Special thanks to Raja Sriswan Mamidi for suggestions)

tableone 0.4.0 (2014-03-30)


  • The showAllLevels argument to show all levels of categorical variables regardless of numbers of levels was added to print.TableOne. Previously, it was only available in print.CatTable. To accommodate this feature, insertLevel argument to insert an empty level column was added to print.ContTable. (Special thanks to Yoshinobu Kanda for suggestions)

tableone 0.3.5 (2014-03-07)


  • Fixed a problem with space insertion when empty strata are present.

  • Thanks Joris Muller for bug reports and code suggestions for the following.

  • Added more robust class assessment in CreateTableOne and CreateCatTable, which now handles ordered factors correctly. CreateTableOne also drops Surv object for safety.

  • "Dropped due to unsupported class" message has been fixed to show variable names with spaces in between.

tableone 0.3.4 (2014-03-04)


  • Added the Create* functions handling of all NA/NaN variables. These invalid variables are examined at the beginning and dropped with warning for safety.

  • For the strata argument, variables with only one level is dropped with warning because these are meaningless, and caused data handling problems.

tableone 0.3.3 (2014-02-22)


  • CreateTableOne now handles logical and chracter vectors correctly. They are handled as categorical variables, and passed to the CreateCatTable function. Variables that are none of numeric, integer, factor, logical, or character are dropped for safety.

tableone 0.3.2 (2014-02-18)


  • DESCRIPTION changed for clarity. No functional changes.

tableone 0.3.1 (2014-02-18)


  • NAMESPACE now includes import(e1071) and import(gmodels).

  • DESCRIPTION now includes Imports e1071, gmodels and Suggests survival, instead of Depends...

tableone 0.3.0 (2014-02-17)


  • CreateTableOne has a new factorVars argument, a character vector specifying numerically coded variables that should be treated as factors.

  • The print method for the TableOne/CatTable class object has a new minMax argument, a logical value specifying whether to show median [min, max] instead of median [IQR] for nonnormal variables

  • The print method for the TableOne/CatTable class object has a new cramVars argument, a character vector to specify which 2-level factors to should have both levels presented in one row.


  • Documentations were fixed to represent the current version.

tableone 0.2.1 (2014-02-15)


  • Documentations were fixed to represent the current version.

tableone 0.2.0 (2014-02-14)


  • CreateTableOne and related print/summary methods were added.

  • CreateTableOne can crate a table with both categorical and continuous variables.

  • The print method can suppress printing by printToggle option.


  • In the Roxygen part of the code, only at_export followed by nothing is used.

tableone 0.1.2 (2014-02-09)


  • Fixed incorrect specification of S3 method export.

  • To make an object an S3 method and export it both at_S3method and at_export tags are needed in the Roxygen part of the code.

  • Passed all the default tests by R CMD check file.tar.gz

tableone 0.1.1 (2014-02-09)


  • This version is to better conform to the CRAN standards.

  • Documents are now included in

tableone 0.1.0 (2014-02-08)


  • This is the first developmental version to be made public.

  • tableone makes creation of "Table 1", description of baseline characteristics common in medical research papers easy.


Reference manual

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


0.13.0 by Kazuki Yoshida, 7 months ago

Browse source code at

Authors: Kazuki Yoshida [cre, aut] , Alexander Bartel [ctb, aut] , Jonathan J Chipman [ctb] , Justin Bohn [ctb] , Lucy DAgostino McGowan [ctb] , Malcolm Barrett [ctb] , Rune Haubo B Christensen [ctb] , gbouzill [ctb]

Documentation:   PDF Manual  

GPL-2 license

Imports survey, MASS, e1071, zoo, gmodels, nlme, labelled

Suggests survival, testthat, Matrix, Matching, reshape2, ggplot2, knitr, geepack, lme4, lmerTest, rmarkdown

Imported by AutoScore, CluMP, cvcrand, jstable, lipidomeR, tldr.

Suggested by RcmdrPlugin.EZR, aba, rpsftm, smd.

See at CRAN