| ith_geom_is | R Documentation |
ith_geom_is checks whether the ith layer uses the prescribed type of geom.
ith_geom_is(p, geom, i = 1)
p |
A ggplot object |
geom |
A character string that corresponds to
the suffix of a ggplot2 |
i |
A numerical index that corresponds to the first layer of a plot (1),
the second layer (2), and so on. |
TRUE or FALSE
Other functions for checking geoms:
get_geoms_stats(),
get_geoms(),
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()
ith_geom_is(p, geom = "smooth", i = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.