Descriptive Statistics, Transition Plots, and More

Tools for making the descriptive "Table 1" used in medical articles, a transition plot for showing changes between categories, flow charts by extending the grid package, a method for variable selection based on the SVD, B├ęzier lines with arrows complementing the ones in the 'grid' package, and more.


NEWS for the Gmisc package

  • Fixed merge with master external descGetMissing (Thanks Peter)
  • Added grid grobs for creating boxes and connecting these with lines
  • Added checkmate for argument checking
  • Fixed bug when providing getDescriptionStatsBy with custom function
  • Added ability add alternative column instead of the p-value column
  • Fixed use_unit issue #16
  • Fixed bug in vignette
  • Added R-version dependency
  • The Transition-class can now handle non-square matrix input
  • The total column is now also passed through the txtInt function
  • Fixed header_count bug in getDescriptionStatsBy - thanks rvlevitin (iss#13)
  • Fixed the naming of proportions in getDescriptionStatsBy
  • If a variable has units set it can now be added into the rowname in getDescriptionStatsBy
  • Merged with the Grmd-package allowing direct access to the docx_document()
  • Prepared for stricter requirements for R 3.3
  • Created the Transition class that can handle multiple transitions in contrast to transitionPlot
  • The bezierArrowGradient has a simpler handling of the gradient proportion
  • The bezier arrows have been rewritten with a > 20x speed increase
  • The getDescriptionStatsBy function is now accompanied by mergeDesc that takes care of merging everything into one table
  • Added ability to customize statistics for getDescriptionStatsBy
  • transitionPlot: The color_bar_labels are now automatically extracted from the transition_flow input
  • transitionPlot: Fixed bug so that the end viewport is the root
  • transitionPlot: Fixed grid arrow bug
  • transitionPlot: When using 3D matrices and two colors there should only be a colorbar when used with gradient arrows
  • transitionPlot: If line width is smaller than the minimum width it is now set to 0
  • htmlTable and some of the formatters have now moved to the 'htmlTable' package
  • forestplot2 has now moved to the 'forestplot' package
  • added the mergeDesc in order to merge lists from getDescriptionStatsBy for
  • All functions default to html = TRUE instead of FALSE
  • show_missing is now useNA in order to match the table() call handling of missing
  • Fixed a few bugs
  • Applied the DRY-documentation principle
  • Added an interactive() check before using the viewer
  • Minor adjustments to the htmlTable handling of no-blank spaces ( )
  • htmlTable now remember the ... argument and passes it on to the print.htmlTable() and cat()
  • Added figCapNo and associated caption function for numbering figure captions
  • Improved documentation
  • Improved the htmlTable viewer handling (thanks Adam Smith)
  • Changed the getDescriptionsBy example to work with the htmlTable() instead of the Hmisc::latex()
  • Fixed getDescriptionsBy bug - the Total column failed when specified to be last - thanks Alexandre Vivot
  • Added example for side-by side plotting for forestplot2
  • As of 0.98.932 the knitr package isn't loaded, instead the metadata or device options indicates that it is knitting
  • htmlTable bug: The function can now handle matrices without column names
  • htmlTable bug: The function deletes and warns when n.rgroup/n.cgroup < 1
  • Bug fix for alt_col not respecting missing rgroup - added also a simple matrix output test
  • Added visual tests for htmlTable and moved one of the examples there
  • Added tableCSSclass option for htmlTable - thanks jphiplip
  • Changed versioning to a 3-digit system as suggested by Yihui Xie
  • Added alt_col for coloring the rows of the htmlTable rgroups - thanks raredd
  • Roxygen2 v 4.0.0 upgrade + other doc upgrades
  • Percentages are now default without space between the number and the %-sign in order to better comply with English language standards
  • transitionPlot - fixed arrow size and empty boxes
  • outputInt now defaults to the ',' formatting according to the English language. It also has no-breaking space if html option is set. It can also handle complex vector/matrix input.
  • describeMean now allows for custom plus minus sign
  • describe* now use the outputInt with the default english settings
  • Minor fix for the print.htmlTable
  • bezierArrowSmplGradient changed name to just bezierArrowGradient
  • Added visual tests and debugged the bezierArrowGradient/transitionPlots
  • Externalized all internal functions of the transitionplot
  • Added proportions for the transitionplot
  • Managed thanks to Baptiste Auguié help on Stack Overflow I know now how to calculate the height of axisGrobs - useful both in the forestplot2 and the transitionPlot functions
  • Fixed the adjustment of the xlabel, the lineheight argument, the viewports for the forestplot2 function
  • Simplified the transitionPlot defaults
  • Fixed a gradient bug in bezierArrowGradient
  • Added the viewer for htmlTable allowing for direct visualisation in RStudio of the tables. Outside RStudio the utils::browseURL is used.
  • htmlTable added table spanner functionality, some man-page update, removed the default NULL arguments in favor of the missing() funciton, and a few minor bugfixes.
  • The bezierArrowSmpl now uses "mm" internally instead of the default "npc" - this improves the rendering as the "npc" is dependent on the axis. A few adjustments to arrow functions were also added.
  • Bugfixes for the bezierArrowSmplGradient.
  • Bugfixed missing data for getDescriptionStats and generated a test-file in order to check most combinations that they work
  • Fixed the legend-bug for forestplot2 when using points
  • Added legend markers option for the forestplot2 function
  • Fixed ticks for forestplot2 - the prFpGetGraphTicksAndClips used the exp() for regular values.
  • Cleaned up some of the code for the fpDrawXXXCI functions
  • Changed depends and imports for the package
  • For LibreOffice compatibility htmlTable now includes caption inside the table when compatibility='LibreOffice'
  • Split the package to exclude regression functions, these are now in the Greg package
  • Added title and label options to transitionPlot
  • Added a size-autofit for the transitionPlot text
  • htmlTable caused too large colspans when cgroup was set
  • Bugfixes for printC&A and getDesc.
  • Added a pvalueFormatter
  • Fixed Intercept bug for get/printCrudeAndAdjusted - didn't include the intercept term
  • Added to forestplot2 ability create customly drawn confidence intervals/boxes
  • Generated diamond, circle and point custom draw functions for forestplot2
  • Added forestplot2 compatibility for the summary
  • Minor bugfixes behind the scenes
  • Fixed issue with getCrudeAndAdjustedModelData mixing up rows for rms objects
  • Added tfoot option to the htmlTable function
  • Switched to the proper caption-align for htmlTable
  • Added options for htmlTable() where you now can format the table counter text and change to Arabic numerals.
  • Bug: changed just to align for printCrudeAndAdjustedModel()
  • Switched the order in the multi-line forestplot for the legend
  • Bugfix for getTics so that it can handle small spans < .5
  • Bugfix for forestplot2 with headers
  • Added title for forestplot2
  • Fixed the margins for forestplot2
  • Added more legend border and fill options to the forestplot2
  • Added the legend.title option in the forestplot2
  • Fixed the auto-sizing of the area for the forestplot2
  • Rows/elements with NA are now not included in the zero-line as they are considered to be headers
  • Added more legend options to the forestplot2
  • Minor changes to simleRmsAnova
  • Added some debugging info for the getDescriptionStatsBy with more detailed errors when unit/total columns don't match
  • Externalized many of the forestplot2 functions and added the option of having a set line height
  • Added new_page option for grid-based plots
  • Updated the simpleRmsAnova function
  • Removed the from transitionplot, this is in order to allow splitting plots, adding it to a viewport etc.
  • Added the lineheight option for forestplot2
  • Fixed the R CMD Check --as-cran to run without any objections
  • Updated dependencies
  • Fixed rownames in printCrudeAndAdjusted
  • Changed printCrudeAndAdjusted to return a matrix subclass instead of immediately printing
  • Ran through som Pkg-check and hopefully cleared out some bugs
  • getCrudeAndAdjusted is now an S3 method that has a default method and a method for rms objects. The rms relies on rms:::summaryrms and returns a matrix that is pruned and used for the situation.
  • printCrudeAndAdjusted has externalized a lot of its functions and handling of the new rms getCrudeAndAdjusted output
  • printCrudeAndAdjusted now ignores any interaction variables
  • forestplot2 fix so that it properly handles data.frames as arguments
  • printCrudeAndAdjustedModel has a better handling of the groups argument
  • Improved import to importFrom
  • The forestplot2 is updated - the widths are now relative to the window size, there is a margin option, and many of the inside functions have moved to helpers outside. Also fixed the alignment of the summary label to work better.
  • Fixed a minor bug for cgroup without rowlabels
  • Added default_ref for both getDescriptionStatsBy and describeProp function.
  • The percentage sign in getDescriptionStatsBy, describProp and describeFactors is now optional.
  • A minor bug fix for cgroup.just for the htmlTable function
  • Minor fix to rownames in htmlTable... again.
  • Had to remove the "terms" option from the plotHR rms:::cph() alternative as it did caused an error ** The error seems to stem from predictrms() where the Adjto function deletes the adjto output in: ** adjto <- if (int.pres) ** model.matrix(Terms.ns, adjto)[, -1, drop = FALSE] ** I will have to look into it one day...
  • Fixed a rowname problem for htmlTable
  • Changed the rowlabel.pos to be by default at the bottom, seems more natural with multi-layered tables.
  • Fixed a caption problem for htmlTable
  • bezierArrowSmpl needed a color for the arrow line as it turned black by default. The line was added to fix the anti-aliasing issue.
  • Changed CSS-defaults for groups when using the function printCrudeAndAdjusted
  • Minor regular expression fix for printCrudeAndAdjusted for the addref. function
  • Minor fix for cgroup.just as this was affected by the previous update
  • Fixed the htmlTable cgroup.just issue
  • The htmlTable is now rendering correct w3c-validated code
  • Minor improvement to the htmlTable function with align now accepting vectors
  • Added multiline cgroup alternative
  • Added a robust alternative for rms ols regressions that now can use the sandwich package
  • Added mergeLists() function for merging multiple lists
  • New options for plotHR
  • Minor fixes to the bezier arrows
  • Update for transitionPlot to avoid overlapping background arrows
  • Thank you Adam Van Iwaarden for fixing the htmlTable alignment and a few bugs!
  • Bug fix for prGetModelVariables affecting model with functions as parameters
  • Added poisson (link=log) to the getCrudeAndAdjusted function to ret exp() values
  • Added transitionPlot ability to indicate proportions in the rectangles
  • Added the bezier arrows to the transition plot
  • Added a bridge option for the transition plot arrows
  • Bugfix for the bezierSmplGradient
  • Added the bezier arrows.
  • Added lwd parameters to the transitionPlot lines
  • Changed the transition matrix - the sums were not necessary as they easily can be calculated from the rowSums/colSums.
  • Added the transitionPlot
  • Bugfix for htmlTable - throws error if a one dimensional x is provided
  • Bugfix for plotHR - there were issues with getting the model data
  • Added option for having specific digits in printCrudeAndAdjustedModel in the model and the descriptive part
  • Added the option of having descriptive data to the printCrudeAndAdjustedModel
  • A completely new way to extract the model dataset
  • Change the option for printCrudeAndAdjustedModel from just html to output alternatives html, latex or raw
  • Altered the name of the describe_ functions to follow the camelCase style, i.e. describe_mean is now describeMean
  • Added the getSvdMostInfluential function
  • The simpleRmsAnovaLatex now has a better handling of the low p-values
  • Fixed a minor but with printCrudeAndAdjusted with the automated reference
  • Added the option of hadding a total column even in "vertical" mode
  • Changed parameter names hrzl_prop.show_perc to total_col_show_perc
  • Bugfix: The total column causes errors if the by contains missing values
  • Fixed a few bugs to the forestplot2

Reference manual

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


1.5 by Max Gordon, a month ago

Report a bug at

Browse source code at

Authors: Max Gordon <>

Documentation:   PDF Manual  

GPL (>= 3) license

Imports grid, grDevices, graphics, lattice, Hmisc, forestplot, abind, methods, knitr, magrittr, rmarkdown, XML, utils, stats, checkmate

Depends on Rcpp, htmlTable

Suggests testthat, datasets

Linking to Rcpp

Depended on by Greg.

See at CRAN