These functions generate placeholder values.
default_label()
can be used as a named argument inuses_labels()
to check that a label matches the result ofget_default_labels()
with that name.default_param()
can be used as a named argument inuses_geom_params()
to check that a parameter matched the result ofget_default_params()
with that name.
Examples
require(ggplot2)
#> Loading required package: ggplot2
p <- ggplot(data = mpg, mapping = aes(x = displ, y = hwy, color = trans)) +
geom_smooth(se = FALSE) +
labs(title = "My plot", x = "Weight", y = "MPG")
uses_labels(p, x = default_label(), color = default_label())
#> x color
#> FALSE TRUE
uses_geom_params(p, "smooth", size = default_param(), se = default_param())
#> size se
#> TRUE FALSE