tags:

views:

32

answers:

2

Hi All,

I am running a Batch file on Windows that runs an Rscript that creates two XML files. However at the end of the second XML file the following gets appended onto it:

> proc.time()

user  system elapsed 

4.97    0.62    7.78

Is there a way of stopping this from happening?

Regards,

Anthony.

+2  A: 

Possibly -- if you remove the call to proc.time() in your script.

Edit: So so NOT use R CMD BATCH foo.R but rather Rscript foo.R.

Dirk Eddelbuettel
Or trim the last five lines with a command line tool.
Greg
proc.time() is not in the Rscript. If I run the Script directly in R, there is no problem. It creates the two files perfectly and quits at the end. The problem only arises when I run the script from a Windows Batch file. The Batch file is only one line: c:\R\bin\Rcmd.exe BATCH "c:\Users\user\Documents\Test.R"
Anthony Keane
Thanks Very much Dirk. Once again you have solved my problem. Greatly appreciated. The batch file now reads as follows: c:\R\bin\Rscript.exe "c:\Users\user\Documents\Test.R"
Anthony Keane
+1  A: 

Add q(runLast=FALSE) to your script, or use --no-timing

From the BATCH help file

Vince