my.df <- data.frame(x = rep(1:10, 2),
y = rep(c(1,2), c(10,10)) + rnorm(20),
group = rep(c("A","B"), c(10,10)))
# by default head() is used to show the top rows of the data object
# and geom_null() to silence the data returned by the stat
ggplot(my.df, aes(x,y)) +
geom_point() +
stat_debug_group()
# geom_debug prints the data returned by the stat
ggplot(my.df, aes(x,y)) +
geom_point() +
stat_debug_group(geom = "debug_panel")
# geom_debug prints the data returned by the stat
ggplot(my.df, aes(x,y)) +
geom_point() +
stat_debug_group(geom = "debug_panel",
geom.dbgfun.params = "summary")
# to print only the the data returned by the stat
# we pass as summary function a function that always returns NULL
ggplot(my.df, aes(x,y)) +
geom_point() +
stat_debug_group(geom = "debug_panel",
dbgfun.data = function(x) {NULL})
ggplot(my.df, aes(x,y)) +
geom_point() +
stat_debug_group(aes(label = paste("group:", group)),
geom = "text")
# here we show all the data object
ggplot(my.df, aes(x,y)) +
geom_point() +
stat_debug_group(dbgfun.data = "I")
# with grouping
ggplot(my.df, aes(x,y, colour = group)) +
geom_point() +
stat_debug_group()
ggplot(my.df, aes(x,y, colour = group)) +
geom_point() +
stat_debug_panel()
ggplot(my.df, aes(x, y, colour = group)) +
geom_point() +
stat_debug_group(dbgfun.data = "nrow")
ggplot(my.df, aes(x, y)) +
geom_point() +
facet_wrap(~group) +
stat_debug_group()
# by default head() is used to show the top rows of data object
ggplot(my.df, aes(group,y)) +
geom_point() +
stat_debug_group()
Run the code above in your browser using DataLab