
Last chance! 50% off unlimited learning
Sale ends in
stat_debug
reports all distinct values in group
and PANEL
, and nrow
, ncol
and the names of the columns
or variables, and the class of x and y for each panel in a ggplot as passed to the
compute_panel
function in the ggproto
object.stat_debug_panel(mapping = NULL, data = NULL, geom = "null",
summary.fun = dplyr::as_data_frame, summary.fun.args = list(),
position = "identity", na.rm = FALSE, show.legend = FALSE,
inherit.aes = TRUE, ...)
aes
or aes_string
. Only needs
to be set at the layer level if you are overriding the plot defadata
object received as
input.NA
, the default, includes if any aesthetics are mapped. FALSE
never includes, and TRUE
always includes.FALSE
, overrides the default aesthetics, rather
than combining with them. This is most useful for helper functions that
define both data and aesthetics and shouldn't inherit behaviour from the
default plot specification, e.g.
stat_debug_group
library(ggplot2)
my.df <- data.frame(x = rep(1:10, 2),
y = rep(c(1,2), c(10,10)),
group = rep(c("A","B"), c(10,10)))
ggplot(my.df, aes(x,y)) + geom_point() + stat_debug_panel()
ggplot(my.df, aes(x,y, colour = group)) + geom_point() + stat_debug_panel()
ggplot(my.df, aes(x,y)) + geom_point() + facet_wrap(~group) + stat_debug_panel()
Run the code above in your browser using DataLab