Learn R Programming

⚠️There's a newer version (3.0.3) 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

1,539

Version

3.0.1

License

GPL (>= 3)

Maintainer

Max Gordon

Last Published

November 19th, 2022

Functions in Gmisc (3.0.1)

boxGrob

Create a box with text
align

Align boxes
bezierArrowSmpl

A simple bezier arrow
Gmisc-package

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

A bezier arrow with gradient
calculateLinesAndArrow

Gets offsetted lines
assert_unit

Checks if unit or number 0-1
Gmisc-deprecated

Deprecated function(s) in Gmisc
Transition-class

A reference class for generating transition plots
boxPropGrob

Create a box with a color split
distance

Get the distance between grid objects
describeFactors

Describes factor variables
copyAllNewAttributes

A simple thing to keep the attributes
descGetMissing

Get statistics for missing data
connectGrob

Connect boxes with an arrow
describeProp

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

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

Describe the mean
coords

Get the box coordinates
convertShowMissing

A function for converting a show_missing variable.
getBezierAdj4Arrw

Gets the bezier points adjusted for an arrow
getDescriptionStatsBy

Creating of description statistics
getPvalWilcox

P-value extractors for getDescriptionStatsBy
getGridVal

Gets grid value
getAbsoluteWidth

Translates "npc" widths into absolute units
figCapNoNext

Gets the next figure caption number
getVectorAngle

Gets an angle
mergeLists

Merging of multiple lists
has

An R alternative to the lodash has in JavaScript
getSvdMostInfluential

Gets the maximum contributor variables from svd()
mergeDesc

Prepares a matrix for htmlTable from a list
gnrlBezierPoints

Generates a generalized Bézier line
isHorizontal

Just a simple help with interpreting the radians
mergeLists_internal

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

Gets the last figure caption number
latex.descMrg

docx_document

Formatter wrapper for html_document, facilitates easier porting to docx
prAddTotalDescColumn

Add a total column to the results
prAddEmptyVals

Convert the by-list into a matrix compatible format
insertRowAndKeepAttr

Insert a row into a matrix
prBuildSubLabel

Add a sub-label to boxPropGrob
figCapNo

Adds a figure caption number
fastDoCall

An alternative to the internal do.call
moveBox

Move a boxGrob
prConvert2Coords

Converts an object to coordinates
pathJoin

A path join function
prFactorDescs

Helper to [getDescriptionStatsBy()]
prCaptionFix

Fixes the caption for elements without caption
prFtpOtherRemoval

Removes other unwanted lines
prFtpOtherChanges

Changes lines for XML-conformity
prCreateBoxCoordinates

Creates coordinates for box
prFtpScriptRemoval

Removes the <script>*</scrip>
prTcPlotBoxColumn

Plots a column of boxes
prTcValidateAndPrepClr

Checks and prepares colors
prAddDescUnitColumn

Add a units column to the results
prAddDescStats

Add a p-value column to the results
prDescGetAndValidateDefaultRef

A helper function for the description stats
print.Gmisc_list_of_boxes

Output boxes
prPushMarginViewport

Pushes viewport with margins
prTpGetBoxPositions

Gets the box position
prSetMaxWidth

Updates the css max-width
prTpPlotBoxes

Plot boxes and arrows
prTpGetBoxPropClr

Gets the color for the given box
prTpPlotArrows

Plots the arrows
prGetDescHeader

Retrieve basic description stats by header
prPasteVec

Collapses a vector for throwing errors
prPropDescs

Helper to [getDescriptionStatsBy()]
prTpPlotBox

Plots the box for the transition plot
validateAndConvertVectorInputs

Checks the input of a vector
yamlDump

Outputs an object
prGetStatistics

Get statistics according to the type
retrieve

An R alternative to the lodash get in JavaScript
set_column_units

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

Just a simple acces to the gp$cex parameter
spread

Spread boxes
prGridPlotTitle

Adds a title to the plot
time2spanTxt

A dense time-span text
prNumericDescs

Helper to [getDescriptionStatsBy()]
set_column_labels

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

Fix rownames for descriptive results
transitionPlot

A transition plot
prTpGetBoxSizedTextGrob

Gets the text size for the box
prTpGetColors

Gets a set of colors or just one color
prFtpHeaderStyle

Helper to ftp_document
prTcPlotArrows

Plots the arrows within a single transition set
prTcMatchClr

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