Hi,
There are many clues in the help.
First I created the file c:\sumfunction.R

x<-as.numeric(commandArgs()[-1:-4] )
print(x)
addtogether<-function(x,y){SUM<-x+y;print(SUM)}
addtogether(x[1],x[2])

Then at the command line in Windows I enter

R --vanilla --slave --args 7 10 <c:\sumfunction.R> c:\logout.txt

Regards
Alex

 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of d. sarthi
maheshwari
Sent: May 16, 2007 8:29 AM
To: [email protected]
Subject: [R] Running R function as a Batch process

Hi,

I am struggling with using R CMD BATCH command. Kindly suggest solution
to the following problem.

I have a function named CinC with accept two input parameters. This can
be shown as:

CinC <- function(start, end)

where start and end both are character strings.

Please suggest me how can I run this function using command R CMD BATCH.

Currently I am trying to do like this -> R CMD BATCH c:/tt/CinC.r
c:/tt/h.Rout -"20070416 08:41" -"20070416 10:33"

What is wrong/incorrect with it?

Your suggestions are important to me. Kindly reply.
Thanks in advance.

Regards
Divya Sarthi

        [[alternative HTML version deleted]]

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to