Sometimes I have very heavy plots in a device in my R session. When, for instance, I change the size of the window where the device is pointing to it gets redrawn quite slowly. Typing Ctrl+C does not seem to kill the plotting task.
Is there a way of "cancelling" or killing a plot in R while it is being drawn?
Edit: I am using Linux and just the normal R shell from a terminal (gnome-terminal usually). Regardless of what system I use I guess there can be many answers covering each system or an integrative answer which shows how to perform this operation on any system.
there is a kill function in package fork http://cran.r-project.org/web/packages/fork/index.html
Now since R doesn't spawn a seperate gnuplot process or smth that you can kill i think you will be able to send a SIGINT to the actual R process to stop the computation. so INT is usually 2 on unices and you want to send a kill -2 to the PID of the R process.
the bad way to do that would be through a
system('pkill -2 R')
:) cheers
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