get_geoms | R Documentation |
get_geoms
returns a vector of geom names, written as character
strings, that describes which geoms in which order are used by a plot.
get_geoms(p)
p |
A ggplot object |
A vector of character strings. Each element corresponds to the suffix
of a ggplot2 geom_
function, e.g. c("point", "line", "smooth")
.
Other functions for checking geoms:
get_geoms_stats()
,
ith_geom_is()
,
ith_geom_stat()
,
ith_geom()
,
uses_geoms()
require(ggplot2)
p <- ggplot(data = mpg, mapping = aes(x = displ, y = hwy)) +
geom_point(mapping = aes(color = class)) +
geom_smooth()
get_geoms(p)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.