get_mappings | R Documentation |
get_mappings
returns the mappings used by a ggplot object or a single
layer extracted from the object with get_geom_layer
or get_stat_layer
.
get_mappings(p, local_only = FALSE)
p |
A ggplot object or a layer extracted from a ggplot object with
|
local_only |
|
When passed a ggplot object (i.e. a plot), get_mappings
will return
only the mappings that have been set globally with
ggplot
. When passed a single layer from a plot, the
behavior of get_mappings
will depend on the value of
local_only
. If local_only = TRUE
, get_mappings
will
return only the mappings defined locally in a layer. When local_only =
FALSE
, get_mappings
will return the combination of global and local
methods that will be used to plot a layer.
A list with class uneval, as returned by aes
Components of the list are either quosures or constants.
Other functions for checking mappings:
identical_aes()
,
ith_mappings_use()
,
ith_mappings()
,
uses_mappings()
require(ggplot2)
p <- ggplot(data = mpg, mapping = aes(x = displ, y = hwy)) +
geom_point(mapping = aes(color = class))
get_mappings(p)
get_mappings(get_geom_layer(p, i = 1), local_only = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.