[R] Running R function as a Batch process

Hanke, Alex HankeA at mar.dfo-mpo.gc.ca
Wed May 16 14:54:18 CEST 2007


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: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of d. sarthi
maheshwari
Sent: May 16, 2007 8:29 AM
To: r-help at stat.math.ethz.ch
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]]

______________________________________________
R-help at stat.math.ethz.ch 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.



More information about the R-help mailing list