ith_stat: Which stat is used in the ith layer?

View source: R/stats.R

ith_statR Documentation

Which stat is used in the ith layer?

Description

ith_stat returns the type of stat used by the ith layer.

Usage

ith_stat(p, i)

Arguments

p

A ggplot object

i

A numerical index that corresponds to the first layer of a plot (1), the second layer (2), and so on.

Value

A character string that corresponds to the suffix of a ggplot2 stat_ function, e.g. "qq".

See Also

Other functions for checking stats: get_stats(), ith_stat_is(), uses_stats()

Examples

require(ggplot2)
p <- ggplot(data = diamonds, aes(sample = price)) +
  geom_qq()
ith_stat(p, i = 1)

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