Learn R Programming

⚠️There's a newer version (3.0.4) of this package.Take me there.

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

4,940

Version

3.0.2

License

GPL (>= 3)

Maintainer

Max Gordon

Last Published

March 13th, 2023

Functions in Gmisc (3.0.2)

align

Align boxes
Transition-class

A reference class for generating transition plots
Gmisc-deprecated

Deprecated function(s) in Gmisc
boxPropGrob

Create a box with a color split
bezierArrowGradient

A bezier arrow with gradient
Gmisc-package

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

Gets offsetted lines
boxGrob

Create a box with text
bezierArrowSmpl

A simple bezier arrow
assert_unit

Checks if unit or number 0-1
connectGrob

Connect boxes with an arrow
describeMean

Describe the mean
coords

Get the box coordinates
descGetMissing

Get statistics for missing data
describeProp

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

A function for converting a show_missing variable.
distance

Get the distance between grid objects
describeFactors

Describes factor variables
describeMedian

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

Formatter wrapper for html_document, facilitates easier porting to docx
getBezierAdj4Arrw

Gets the bezier points adjusted for an arrow
fastDoCall

An alternative to the internal do.call
getPvalWilcox

P-value extractors for getDescriptionStatsBy
copyAllNewAttributes

A simple thing to keep the attributes
getGridVal

Gets grid value
getDescriptionStatsBy

Creating of description statistics
figCapNoNext

Gets the next figure caption number
getAbsoluteWidth

Translates "npc" widths into absolute units
has

An R alternative to the lodash has in JavaScript
gnrlBezierPoints

Generates a generalized Bézier line
getSvdMostInfluential

Gets the maximum contributor variables from svd()
getVectorAngle

Gets an angle
figCapNo

Adds a figure caption number
moveBox

Move a boxGrob
mergeDesc

Prepares a matrix for htmlTable from a list
latex.descMrg

pathJoin

A path join function
figCapNoLast

Gets the last figure caption number
insertRowAndKeepAttr

Insert a row into a matrix
isHorizontal

Just a simple help with interpreting the radians
prAddDescStats

Add a p-value column to the results
prAddEmptyVals

Convert the by-list into a matrix compatible format
prAddTotalDescColumn

Add a total column to the results
prFtpHeaderStyle

Helper to ftp_document
prFixDescRownames

Fix rownames for descriptive results
prAddDescUnitColumn

Add a units column to the results
prBuildSubLabel

Add a sub-label to boxPropGrob
mergeLists

Merging of multiple lists
prCaptionFix

Fixes the caption for elements without caption
mergeLists_internal

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

Removes the <script>*</scrip>
prGetStatistics

Get statistics according to the type
prGetTextGrobCex

Just a simple acces to the gp$cex parameter
prConvert2Coords

Converts an object to coordinates
prTcMatchClr

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

Plots the arrows within a single transition set
prTpGetBoxPositions

Gets the box position
prTpGetBoxPropClr

Gets the color for the given box
prFtpOtherChanges

Changes lines for XML-conformity
prFtpOtherRemoval

Removes other unwanted lines
prGetDescHeader

Retrieve basic description stats by header
prTcPlotBoxColumn

Plots a column of boxes
prTcValidateAndPrepClr

Checks and prepares colors
prPushMarginViewport

Pushes viewport with margins
prCreateBoxCoordinates

Creates coordinates for box
print.Gmisc_list_of_boxes

Output boxes
prSetMaxWidth

Updates the css max-width
prTpPlotBoxes

Plot boxes and arrows
prFactorDescs

Helper to [getDescriptionStatsBy()]
prDescGetAndValidateDefaultRef

A helper function for the description stats
prPasteVec

Collapses a vector for throwing errors
prTpGetBoxSizedTextGrob

Gets the text size for the box
prPropDescs

Helper to [getDescriptionStatsBy()]
prTpGetColors

Gets a set of colors or just one color
time2spanTxt

A dense time-span text
prTpPlotArrows

Plots the arrows
transitionPlot

A transition plot
prTpPlotBox

Plots the box for the transition plot
validateAndConvertVectorInputs

Checks the input of a vector
yamlDump

Outputs an object
prGridPlotTitle

Adds a title to the plot
set_column_labels

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

Helper to [getDescriptionStatsBy()]
retrieve

An R alternative to the lodash get in JavaScript
set_column_units

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

Spread boxes