Skip to content
Prev 166598 / 398502 Next

Arguments for Rcmd BATCH

Dear Professor Ripley,

Firstly, thank you very much for your advice. I was not aware my R was so
old. Sorry I must have missed the instruction on reading the posting
guidelines.

I have updated it and it now runs again. This is a big step forward. However
it is not running properly (or I am doing something wrong).

There are still two problems may I ask for your help with please?

1. When I call the script it fails with the following message in the output
file:
Error in commandArgs(TRUE) : unused argument(s) (TRUE)
Execution halted

2. The diagnostic details (that should be going to test01b.ROUT are now
going to strange places, overwriting the test01b.R file if I do not include
the < and > redirectors.

I am now using the following syntax, from the manual:

Rcmd BATCH --no-save --no-restore --args parms=c(1,2,3) < test01b.R >
test01b.ROUT

Currently it is writing the output to "parms=c(1,2,3).ROUT"

This is attached but says "fatal error cannot open file "--args"

The file test01b.ROUT is created but empty.

I get the same results if I start it with R CMD BATCH ...

Is the a difference between R CMD... and Rcmd... please? The manual is not
very clear on this.

I am sorry to impose on you but guess I am still doing something wrong. I
have looked through the documentation but cannot find much on this or many
examples.

Many thanks,

Andrew Hicks


-----Original Message-----
From: Prof Brian Ripley [mailto:ripley at stats.ox.ac.uk] 
Sent: 10 January 2009 18:18
To: Andrew Hicks
Cc: r-help at r-project.org
Subject: Re: [R] Arguments for Rcmd BATCH

Your R is far too old, and in particular too old for the example you 
are trying.

Please do you as asked in the posting guide to do before posting, and 
upgrade.  Then you will have Rscript, as described in the current 'An 
Introduction to R' manual for this purpose (with examples).
On Sat, 10 Jan 2009, Andrew Hicks wrote:

            
under
well.
parms[2],
BATCH.