forked from tidyverse/ggplot2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlayer.Rd
51 lines (44 loc) · 1.94 KB
/
layer.Rd
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
39
40
41
42
43
44
45
46
47
48
49
50
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/layer.r
\name{layer}
\alias{layer}
\title{Create a new layer}
\usage{
layer(geom = NULL, geom_params = list(), stat = NULL,
stat_params = list(), data = NULL, mapping = NULL, position = NULL,
params = list(), inherit.aes = TRUE, subset = NULL, show.legend = NA)
}
\arguments{
\item{geom,stat,position}{Geom, stat and position adjustment to use in
this layer. Can either be the name of a ggproto object, or the object
itself.}
\item{geom_params,stat_params,params}{Additional parameters to the
\code{geom} and \code{stat}. If supplied individual in \code{...} or as a
list in \code{params}, \code{layer} does it's best to figure out which
arguments belong to which. To be explicit, supply as individual lists to
\code{geom_param} and \code{stat_param}.}
\item{data}{A data frame. If specified, overrides the default data frame
defined at the top level of the plot.}
\item{mapping}{Set of aesthetic mappings created by \code{\link{aes}} or
\code{\link{aes_string}}. If specified and \code{inherit.aes = TRUE},
is combined with the default mapping at the top level of the plot.}
\item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics,
rather than combining with them. This is most useful for helper functions
that define both data and aesthetics and shouldn't inherit behaviour from
the default plot specification, e.g. \code{\link{borders}}.}
\item{subset}{DEPRECATED. An older way of subsetting the dataset used in a
layer.}
\item{show.legend}{logical. Should this layer be included in the legends?
\code{NA}, the default, includes if any aesthetics are mapped.
\code{FALSE} never includes, and \code{TRUE} always includes.}
}
\description{
Create a new layer
}
\examples{
# geom calls are just a short cut for layer
ggplot(mpg, aes(displ, hwy)) + geom_point()
# shortcut for
ggplot(mpg, aes(displ, hwy)) +
layer(geom = "point", stat = "identity", position = "identity")
}