How can I save the box plot as a variable in R? For example, if I did like this,
plot <- boxplot(count ~ spray, data = InsectSprays, col = "lightgray")
when I call plot, I want it shows the box plot, that I don't need to run the command for plotting boxplot every time.
Does anyone have any idea?
The following does it. Call after that recordedPlot
boxplot(count ~ spray, data = InsectSprays, col = "lightgray")
recordedPlot = recordPlot()
dev.off()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With