I would like to observe a lengthy optimization process cycle by cycle doing a ggplot2-graphic at the end of each cycle and looking at it while the next cycle is proceeding (~1.5min/pic).
Drawing the picture is not the problem. However, after several cycles (within a complete process there are some 50...200 cycles and as many pictures) I noticed that my computer (or RStudio?) is running out of memory or code space and starts to jump around erratically within preceding pictures - which btw I don't need any more. I would just like to follow the movie!-)
I couldn't find a suitable command just to wipe off the existing picture before ggplot2 starts drawing the next one. How could I achieve that?