File: ggMisc.Rd

package info (click to toggle)
hmisc 4.2-0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 3,332 kB
  • sloc: asm: 27,116; fortran: 606; ansic: 411; xml: 160; makefile: 2
file content (38 lines) | stat: -rw-r--r-- 1,326 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
\name{colorFacet}
\alias{colorFacet}
\alias{arrGrob}
\alias{print.arrGrob}
\title{Miscellaneous ggplot2 and grid Helper Functions}
\description{
These functions are used on \code{ggplot2} objects or as layers when
building a \code{ggplot2} object, and to facilitate use of
\code{gridExtra}.  \code{colorFacet} colors the thin 
rectangles used to separate panels created by \code{facet_grid} (and
probably by \code{facet_wrap}). 
A better approach may be found at \url{http://stackoverflow.com/questions/28652284}.
\code{arrGrob} is a front-end to \code{gridExtra::arrangeGrob} that
allows for proper printing.  See
\url{http://stackoverflow.com/questions/29062766/store-output-from-gridextragrid-arrange-into-an-object}.  The \code{arrGrob} \code{print} method calls \code{grid::grid.draw}.
}
\usage{
colorFacet(g, col = adjustcolor("blue", alpha.f = 0.3))

arrGrob(\dots)

\method{print}{arrGrob}(x, \dots)
}
\arguments{
  \item{g}{a \code{ggplot2} object that used faceting}
	\item{col}{color for facet separator rectanges}
	\item{\dots}{passed to \code{arrangeGrob}}
	\item{x}{an object created by \code{arrGrob}}
}
\author{Sandy Muspratt}
\examples{
\dontrun{
s <- summaryP(age + sex ~ region + treatment)
colorFacet(ggplot(s))   # prints directly
# arrGrob is called by rms::ggplot.Predict and others
}
}
\keyword{hplot}