I would like to be able to run an R script from the command line using RScript.exe. The problem is, my script generates some plots which are being automatically closed as soon as the script reaches its end. Is there a way to force the plot windows to remain open until the user explicitly closes them? Example: Rscript --vanilla -e "plot(1:100)" The above line will create a plot that exists for a split second and then is gone - this seems like completely retarded behavior for a programming language that is so dependent upon plots. -- View this message in context: http://www.nabble.com/Plots-automatically-closing-when-using-RScript-tp23820355p23820355.html Sent from the R help mailing list archive at Nabble.com.
Gabor Grothendieck
2009-Jun-01 22:16 UTC
[R] Plots automatically closing when using RScript
Try this: Rscript -e "png('abc.png');plot(1:10);dev.off()" && abc.png On Mon, Jun 1, 2009 at 3:23 PM, Rhizomorph <khufu_lotus at yahoo.com> wrote:> > I would like to be able to run an R script from the command line using > RScript.exe. The problem is, my script generates some plots which are being > automatically closed as soon as the script reaches its end. Is there a way > to force the plot windows to remain open until the user explicitly closes > them? > > Example: > > Rscript --vanilla -e "plot(1:100)" > > The above line will create a plot that exists for a split second and then is > gone - this seems like completely retarded behavior for a programming > language that is so dependent upon plots. > -- > View this message in context: http://www.nabble.com/Plots-automatically-closing-when-using-RScript-tp23820355p23820355.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >