Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ggMisc

Miscellaneous ggplot2 and grid Helper Functions


Description

These functions are used on ggplot2 objects or as layers when building a ggplot2 object, and to facilitate use of gridExtra. colorFacet colors the thin rectangles used to separate panels created by facet_grid (and probably by facet_wrap). A better approach may be found at https://stackoverflow.com/questions/28652284/. arrGrob is a front-end to gridExtra::arrangeGrob that allows for proper printing. See https://stackoverflow.com/questions/29062766/store-output-from-gridextragrid-arrange-into-an-object/. The arrGrob print method calls grid::grid.draw.

Usage

colorFacet(g, col = adjustcolor("blue", alpha.f = 0.3))

arrGrob(...)

## S3 method for class 'arrGrob'
print(x, ...)

Arguments

g

a ggplot2 object that used faceting

col

color for facet separator rectanges

...

passed to arrangeGrob

x

an object created by arrGrob

Author(s)

Sandy Muspratt

Examples

## Not run: 
s <- summaryP(age + sex ~ region + treatment)
colorFacet(ggplot(s))   # prints directly
# arrGrob is called by rms::ggplot.Predict and others

## End(Not run)

Hmisc

Harrell Miscellaneous

v4.5-0
GPL (>= 2)
Authors
Frank E Harrell Jr <fh@fharrell.com>, with contributions from Charles Dupont and many others.
Initial release
2021-02-27

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.