# echo to the R console \code{data} as received by geoms
ggplot(mtcars, aes(cyl, mpg, color = factor(cyl))) +
geom_point() +
geom_debug_panel()
ggplot(mtcars, aes(cyl, mpg, color = factor(cyl))) +
geom_point() +
geom_debug_group()
ggplot(mtcars, aes(cyl, mpg, color = factor(cyl))) +
geom_point() +
geom_debug_panel(dbgfun.params = NULL)
ggplot(mtcars, aes(cyl, mpg, color = factor(cyl))) +
geom_point() +
geom_debug_panel(dbgfun.data = NULL)
ggplot(mtcars, aes(cyl, mpg, color = factor(cyl))) +
geom_point() +
geom_debug_panel(dbgfun.data = "head", dbgfun.data.args = list(n = 3))
ggplot(mtcars, aes(cyl, mpg, color = factor(cyl))) +
geom_point() +
geom_debug_panel(dbgfun.data = "nrow", dbgfun.params = "length")
ggplot(mtcars, aes(cyl, mpg, color = factor(cyl))) +
geom_point() +
geom_debug_panel(dbgfun.data = "attributes", dbgfun.params = "attributes")
ggplot(mtcars, aes(cyl, mpg, color = factor(cyl))) +
geom_point() +
geom_debug_panel(dbgfun.data = "I", dbgfun.params = NULL)
# echo to the R console \code{data} as received by geoms
ggplot(mtcars, aes(cyl, mpg, colour = factor(cyl))) +
stat_summary(fun.data = "mean_se") +
stat_summary(geom = "debug_panel", fun.data = "mean_se")
ggplot(mtcars, aes(cyl, mpg, colour = factor(cyl))) +
stat_summary(fun.data = "mean_se") +
stat_summary(geom = "debug_panel", fun.data = "mean_se", dbgfun.params = NULL)
# shape data is not passed to geometries or statistics
if (requireNamespace("sf", quietly = TRUE)) {
nc <-
sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE)
ggplot(data = nc) +
geom_sf(color = "darkblue", fill = "white") +
geom_debug_panel()
}
# backwards compatibility
ggplot(mtcars, aes(cyl, mpg, color = factor(cyl))) +
geom_point() +
geom_debug()
ggplot(mtcars, aes(cyl, mpg, colour = factor(cyl))) +
stat_summary(fun.data = "mean_se") +
stat_summary(geom = "debug", fun.data = "mean_se")
Run the code above in your browser using DataLab