uses_stat_param | R Documentation |
uses_stat_param
is a mirror function of uses_geom_param
but instead of checking a plot's
geom layer, it checks that a plot's stat layer uses a specific stat parameter.
uses_stat_param(p, stat, params, i = NULL)
p |
A ggplot object |
stat |
A character string found in the suffix of a ggplot2 stat function,
e.g. |
params |
A named list of stat or geom parameter values, e.g. |
i |
A numerical index, e.g. |
To specify a specific stat layer, either specify using position using the i
index or
by using a combination of stat
function suffix name and i
to check the ith layer that
uses the stat.
A boolean
require(ggplot2)
p <- ggplot(diamonds, aes(carat)) +
stat_bin(bins = 200)
uses_stat_param(p, stat = "bin", params = list(bins = 200))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.