get_geoms_stats: List the geom and stat combination used by all layers of a...

View source: R/geoms.R

get_geoms_statsR Documentation

List the geom and stat combination used by all layers of a plot.

Description

List the geom and stat combination used by all layers of a plot.

Usage

get_geoms_stats(p)

Arguments

p

A ggplot object

Value

A list of lists with a GEOM and STAT character. e.g. list(list(GEOM = "point", STAT = "identity"))

See Also

Other functions for checking geoms: get_geoms(), ith_geom_is(), ith_geom_stat(), ith_geom(), uses_geoms()

Examples

require(ggplot2)
p <- ggplot(data = mpg, mapping = aes(x = displ, y = hwy)) +
  geom_point(mapping = aes(color = class)) +
  geom_smooth()
get_geoms_stats(p)

rstudio-education/ggcheck documentation built on May 12, 2023, 11:33 a.m.