I have have a R script which queries a database, runs some analysis, plots a few charts based on the current system date.
I want to get this script to run daily at boot, I thought I could do this fairly simply using a shortcut to rscript.exe with necessary parameters.
This works fine, however the script quits after it is run, not very useful for viewing the charts.
I'm using XP and win7.
Is there an easy way to keep the output from the script on screen? I've tried incorporating scan into the script, but it doesn't pause.
I know I could just open the rgui, and run a single line of code, but the plan is to deploy this to a colleague's computer who is totally unfamiliar with R.
This works for me on Linux:
#!/usr/bin/env Rscript
X11()
with(mtcars, plot(mpg, hp))
locator(1)
The user has to click the plot window before it disappears. I presume it would work on Windows with a call to windows()
instead.
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