[R] R CMD BATCH continue after an error in the script

2009-12-05 Thread Veronesi, Fabio

Hi,
I have a problem with R CMD BATCH, because I created a .bat file to run a 
script:

C:\R\R-2.9.2\bin\R CMD BATCH C:\Scrip_test.R

It work perfectly but after 3 lines of script there is a line with a nls() 
function that cannot be fitted and this end in an error message.
I'm not bother by the error message, I just want that the script continue.

If I use the R windows GUI the script show the error message but it continue 
till the very end. 
I want that the script continue to run also in BATCH mode, How can I do that?

Many thanks in advance,
Fabio


Fabio Veronesi
Ph.D Student

Cranfield University
School of Applied Sciences
Building 37
Cranfield, Bedforshire
MK43 0AL

tel. +4407984049316

__
R-help@r-project.org 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.


Re: [R] R CMD BATCH continue after an error in the script

2009-12-05 Thread Hrishi Mittal

Fabio,

If you're not using the nls() function's result, then why don't you comment
it out from the script? That way, there will be no error and the script will
work fine.

Please post your script if you need further help.


Veronesi, Fabio wrote:
 
 
 Hi,
 I have a problem with R CMD BATCH, because I created a .bat file to run a
 script:
 
 C:\R\R-2.9.2\bin\R CMD BATCH C:\Scrip_test.R
 
 It work perfectly but after 3 lines of script there is a line with a nls()
 function that cannot be fitted and this end in an error message.
 I'm not bother by the error message, I just want that the script continue.
 
 If I use the R windows GUI the script show the error message but it
 continue till the very end. 
 I want that the script continue to run also in BATCH mode, How can I do
 that?
 
 Many thanks in advance,
 Fabio
 
 
 Fabio Veronesi
 Ph.D Student
 
 Cranfield University
 School of Applied Sciences
 Building 37
 Cranfield, Bedforshire
 MK43 0AL
 
 tel. +4407984049316
 
 __
 R-help@r-project.org 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.
 
 

-- 
View this message in context: 
http://n4.nabble.com/R-CMD-BATCH-continue-after-an-error-in-the-script-tp949199p949207.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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.


Re: [R] R CMD BATCH continue after an error in the script

2009-12-05 Thread David Winsemius


On Dec 5, 2009, at 9:21 AM, Veronesi, Fabio wrote:

Hi,
I have a problem with R CMD BATCH, because I created a .bat file to  
run a script:


C:\R\R-2.9.2\bin\R CMD BATCH C:\Scrip_test.R

It work perfectly but after 3 lines of script there is a line with a  
nls() function that cannot be fitted and this end in an error message.
I'm not bother by the error message, I just want that the script  
continue.


The try function will provide a mechaism for gracefully stepping  
around coding potholes.


?try

If I use the R windows GUI the script show the error message but it  
continue till the very end.
I want that the script continue to run also in BATCH mode, How can I  
do that?


Many thanks in advance,
Fabio


Fabio Veronesi
Ph.D Student

Cranfield University
School of Applied Sciences



David Winsemius, MD
Heritage Laboratories
West Hartford, CT

__
R-help@r-project.org 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.