[R] Automating R script with Windows 7
jholtman at gmail.com
Mon Mar 5 19:26:37 CET 2012
Just save your R script as a plain text file. Here is a copy of a
file that I will show you how to execute; it is saved as \temp\test.r
cat('this is my R script executing\n', format(Sys.Date()))
Here is the command that I execute at the 'CMD' prompt and that you
would have scheduled by Windows:
This has the full path name (on my machine) to the 'Rscript.exe'
program included in R for executing scripts
Here is the output from the execution on the command prompt screen:
this is my R script executing
So it is easy to setup. Let me know if you have any problems.
On Mon, Mar 5, 2012 at 11:55 AM, vincent.deluard
<vincentdeluardr at gmail.com> wrote:
> Hi R-users,
> I am trying to automate the daily running of a simple R script from Windows
> >From previous posts, I understand that this needs to be done with the task
> I can schedule my laptop to automatically open R at a certain time, but not
> to execute a script.
> Secondary question: how do I save a list of R commands so that they get
> executed once the file is open?
> Right now, I save my code in a notepad doc and paste over in R, but there
> has to be another way. I have tried saving my code as .r file using the
> editor and open the file with R later but this does not seem to execute the
> I very much appreciate the help.
> Vincent Deluard, CFA
> View this message in context: http://r.789695.n4.nabble.com/Automating-R-script-with-Windows-7-tp4446693p4446693.html
> Sent from the R help mailing list archive at Nabble.com.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Data Munger Guru
What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.
More information about the R-help