In ggplot2
, one can easily save a graphic into a R object.
p = ggplot(...) + geom_point() # does not display the graph
p # displays the graph
The standard function plot
produces the graphic as a void function and returns NULL.
p = plot(1:10) # displays the graph
p # NULL
Is it possible to save a graphic created by plot
in an object?
plot
is a generic, and differentplot
methods do return such objects as far as I know.plot.default
, however, indeed returnsNULL
.p
after saving it as an object? Or would you like to save it as an object which you would then be able to alter its values for example?