Learn R Programming

The Gmisc package

Tools for making:

  • the descriptive "Table 1" used in medical articles
  • transition plot for showing changes between categories
  • flow charts based on 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.

Copy Link

Version

Install

install.packages('Gmisc')

Monthly Downloads

2,373

Version

3.0.4

License

GPL (>= 3)

Maintainer

Max Gordon

Last Published

August 19th, 2025

Functions in Gmisc (3.0.4)

describeMedian

A function that returns a description median that contains the interquartile range or the full range
describeProp

A function that returns a description proportion that contains the number and the percentage
describeMean

Describe the mean
convertShowMissing

A function for converting a show_missing variable.
coords

Get the box coordinates
copyAllNewAttributes

A simple thing to keep the attributes
connectGrob

Connect boxes with an arrow
describeFactors

Describes factor variables
descGetMissing

Get statistics for missing data
distance

Get the distance between grid objects
getBezierAdj4Arrw

Gets the bezier points adjusted for an arrow
figCapNoNext

Gets the next figure caption number
getGridVal

Gets grid value
figCapNoLast

Gets the last figure caption number
figCapNo

Adds a figure caption number
getPvalWilcox

P-value extractors for getDescriptionStatsBy
getDescriptionStatsBy

Creating of description statistics
getAbsoluteWidth

Translates "npc" widths into absolute units
docx_document

Formatter wrapper for html_document, facilitates easier porting to docx
fastDoCall

An alternative to the internal do.call
has

An R alternative to the lodash has in JavaScript
insertRowAndKeepAttr

Insert a row into a matrix
isHorizontal

Just a simple help with interpreting the radians
mergeDesc

Prepares a matrix for htmlTable from a list
getSvdMostInfluential

Gets the maximum contributor variables from svd()
gnrlBezierPoints

Generates a generalized Bézier line
mergeLists

Merging of multiple lists
getVectorAngle

Gets an angle
latex.descMrg

mergeLists_internal

A helper function for mergeLists that does the actual work.
prAddEmptyVals

Convert the by-list into a matrix compatible format
prConvert2Coords

Converts an object to coordinates
prCreateBoxCoordinates

Creates coordinates for box
prAddTotalDescColumn

Add a total column to the results
prCaptionFix

Fixes the caption for elements without caption
moveBox

Move a boxGrob
prBuildSubLabel

Add a sub-label to boxPropGrob
prFtpHeaderStyle

Helper to ftp_document
prFixDescRownames

Fix rownames for descriptive results
prFactorDescs

Helper to [getDescriptionStatsBy()]
pathJoin

A path join function
prDescGetAndValidateDefaultRef

A helper function for the description stats
prFtpOtherChanges

Changes lines for XML-conformity
prFtpOtherRemoval

Removes other unwanted lines
prGetDescHeader

Retrieve basic description stats by header
prAddDescStats

Add a p-value column to the results
prAddDescUnitColumn

Add a units column to the results
prGridPlotTitle

Adds a title to the plot
prGetStatistics

Get statistics according to the type
prGetTextGrobCex

Just a simple acces to the gp$cex parameter
prFtpScriptRemoval

Removes the <script>*</scrip>
prTcPlotBoxColumn

Plots a column of boxes
prPushMarginViewport

Pushes viewport with margins
prTcMatchClr

Finds the matching colors for the new addition based on the original set of colors
prTpPlotArrows

Plots the arrows
prTcValidateAndPrepClr

Checks and prepares colors
prNumericDescs

Helper to [getDescriptionStatsBy()]
prTcPlotArrows

Plots the arrows within a single transition set
prTpGetBoxPositions

Gets the box position
prTpGetBoxPropClr

Gets the color for the given box
prTpPlotBox

Plots the box for the transition plot
set_column_labels

Add [Hmisc::label()] to multiple columns
time2spanTxt

A dense time-span text
transitionPlot

A transition plot
retrieve

An R alternative to the lodash get in JavaScript
prSetMaxWidth

Updates the css max-width
set_column_units

Add [Hmisc::unit()] to multiple columns
spread

Spread boxes
prTpPlotBoxes

Plot boxes and arrows
prPropDescs

Helper to [getDescriptionStatsBy()]
prPasteVec

Collapses a vector for throwing errors
prTpGetBoxSizedTextGrob

Gets the text size for the box
prTpGetColors

Gets a set of colors or just one color
print.Gmisc_list_of_boxes

Output boxes
validateAndConvertVectorInputs

Checks the input of a vector
yamlDump

Outputs an object
Gmisc-package

Collection of functions for plotting relations, generating tables, and more.
boxGrob

Create a box with text
bezierArrowGradient

A bezier arrow with gradient
boxPropGrob

Create a box with a color split
Transition-class

A reference class for generating transition plots
bezierArrowSmpl

A simple bezier arrow
calculateLinesAndArrow

Gets offsetted lines
align

Align boxes
assert_unit

Checks if unit or number 0-1
Gmisc-deprecated

Deprecated function(s) in Gmisc