I have code to clear the workspace: rm(list=ls()) and code to clear the console: cat(\"\\014\")
rm(list=ls())
cat(\"\\014\")
Is there code to clear all plots from Rstudio?<
To prevent error message in case there are no plots to clear:
if(!is.null(dev.list())) dev.off()