File: label_bquote.Rd

package info (click to toggle)
r-cran-ggplot2 2.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,744 kB
  • sloc: sh: 9; makefile: 2
file content (32 lines) | stat: -rw-r--r-- 1,109 bytes parent folder | download
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/labeller.r
\name{label_bquote}
\alias{label_bquote}
\title{Label with mathematical expressions}
\usage{
label_bquote(rows = NULL, cols = NULL, default = label_value)
}
\arguments{
\item{rows}{Backquoted labelling expression for rows.}

\item{cols}{Backquoted labelling expression for columns.}

\item{default}{Default labeller function for the rows or the
columns when no plotmath expression is provided.}
}
\description{
\code{label_bquote()} offers a flexible way of labelling
facet rows or columns with plotmath expressions. Backquoted
variables will be replaced with their value in the facet.
}
\examples{
# The variables mentioned in the plotmath expression must be
# backquoted and referred to by their names.
p <- ggplot(mtcars, aes(wt, mpg)) + geom_point()
p + facet_grid(vs ~ ., labeller = label_bquote(alpha ^ .(vs)))
p + facet_grid(. ~ vs, labeller = label_bquote(cols = .(vs) ^ .(vs)))
p + facet_grid(. ~ vs + am, labeller = label_bquote(cols = .(am) ^ .(vs)))
}
\seealso{
\link{labellers}, \code{\link{labeller}()},
}