# NOT RUN {
library(ggplot2)
p <- ggplot(mpg, aes(factor(year), (cty + hwy) / 2)) +
geom_boxplot() +
geom_point(color = "red") +
facet_grid(. ~ class) +
ggtitle("Example plot")
p
# str(p) vs. summary(p)
str(p, max.level = 1, size = FALSE)
summary(p)
# structure of p at 2 levels of nesting
str(p, max.level = 2)
# top level structure and size of p
str(p, max.level = 0)
# structure and size of p["data"]
str(p, components = "data")
# }
Run the code above in your browser using DataLab