Overrides the default `ggplot` function from the ggplot2 package, adding the capability to track the history of plot construction. This function initializes a history attribute in the `ggplot` object.

ggplot(...)

Arguments

...

Arguments passed to the original ggplot function from ggplot2.

Value

A ggplot object of class 'ggcall', with an additional attribute 'ggcall' that stores the history of plot construction.

See also

Examples

library(ggplot2, exclude = "ggplot")
p <- ggplot(mtcars, aes(x = wt, y = mpg))
# the + function has to come from ggcall package
attr(p + geom_point(), "ggcall")
#> ggplot(mtcars, aes(x = wt, y = mpg)) + geom_point()