[R] R Batch Mode Customized Input

koj jens.koch at gmx.li
Wed Dec 2 11:24:21 CET 2009


Dear all, 

I use R in Batch Mode with the following syntax:

X:\...\Rcmd BATCH --slave X\...\test.R X:\...\Log.txt 

It works very fine. 

Now I want to write a function and customize the input for my R-File, e.g I
want to define the start and the end date.

Let's assume that test.R includes only a function like this: 

analysis<-function(start.date,end.date){...}

Is it possible to give the arguments of the function via Batch Mode, e.g.
start.date=c("2009-10-01") and end.date=c("2009-10-31")? Normally I would do
this as following: result<-analysis(c("2009-10-01"),c("2009-10-31")). 

Going away from the function: It were sufficent, if the R-Script test.R were
running and recognizing start.date and end.date in the same manner as I
would write the dates in the top of the file.

The background: I am searching for a possibility, that my colleagues can use
my files without programming skills in R and without the necessity of
opening R. The batch mode is a great thing at this point - the actual
problem for me is the missing  possibility of define some details.

Have you any suggestions to solve my problem? Probably there are other
possibilities I don't see at the moment. If other people could enter the
dates in the example (in which way respectively in which platform is to
define) and start the R-File without R-knowledge, in whatever way, this were
the optimal solution. 

Thank you very much in advance,

Jens.













-- 
View this message in context: http://n4.nabble.com/R-Batch-Mode-Customized-Input-tp932947p932947.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list