ith_geom_is checks whether the ith layer uses the prescribed type of geom.
See also
Other functions for checking geoms:
get_geoms(),
get_geoms_stats(),
ith_geom(),
ith_geom_stat(),
uses_geoms()
Examples
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)
#> [1] TRUE
