how to know perfect execution of function ? & if error occurred in execution,how to report it?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

how to know perfect execution of function ? & if error occurred in execution,how to report it?

sagarnikam123
i have one for loop,in which i am dealing with time series & arima function,
while iterating at some stage there is a error, like

Error in arima(x, c(p, 0, q)) : non-stationary AR part from CSS

i want to know at which step this error occurred & print that iterating number

e.g.
x<-c(1:10)
for (i in 1:5 ){
z<-arima(x[i])
print(z)
}

if error occurred in arima function at i=3 step, it should report & execute complete loop until i=5
Sagar Nikam
B.Pharm, M.Sc(Bioinformatics)
Software Engineer (Data Research Analyst )
Trendwise Analytics,Bangalore
India
Reply | Threaded
Open this post in threaded view
|

Re: how to know perfect execution of function ? & if error occurred in execution, how to report it?

jholtman
?try

Sent from my iPad

On Mar 23, 2012, at 3:32, sagarnikam123 <[hidden email]> wrote:

> i have one for loop,in which i am dealing with time series & arima function,
> while iterating at some stage there is a error, like
>
> Error in arima(x, c(p, 0, q)) : non-stationary AR part from CSS
>
> i want to know at which step this error occurred & print that iterating
> number
>
> e.g.
> x<-c(1:10)
> for (i in 1:5 ){
> z<-arima(x[i])
> print(z)
> }
>
> if error occurred in arima function at i=3 step, it should report & execute
> complete loop until i=5
>
> --
> View this message in context: http://r.789695.n4.nabble.com/how-to-know-perfect-execution-of-function-if-error-occurred-in-execution-how-to-report-it-tp4498037p4498037.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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 | Threaded
Open this post in threaded view
|

Re: how to know perfect execution of function ? & if error occurred in execution, how to report it?

beleites,claudia
In addition, if you need to dig down why the error occurs:

?traceback
?recover

HTH Claudia


Am 23.03.2012 10:29, schrieb Jim Holtman:

> ?try
>
> Sent from my iPad
>
> On Mar 23, 2012, at 3:32, sagarnikam123 <[hidden email]> wrote:
>
>> i have one for loop,in which i am dealing with time series & arima function,
>> while iterating at some stage there is a error, like
>>
>> Error in arima(x, c(p, 0, q)) : non-stationary AR part from CSS
>>
>> i want to know at which step this error occurred & print that iterating
>> number
>>
>> e.g.
>> x<-c(1:10)
>> for (i in 1:5 ){
>> z<-arima(x[i])
>> print(z)
>> }
>>
>> if error occurred in arima function at i=3 step, it should report & execute
>> complete loop until i=5
>>
>> --
>> View this message in context: http://r.789695.n4.nabble.com/how-to-know-perfect-execution-of-function-if-error-occurred-in-execution-how-to-report-it-tp4498037p4498037.html
>> Sent from the R help mailing list archive at Nabble.com.
>>
>> ______________________________________________
>> [hidden email] 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.
>
> ______________________________________________
> [hidden email] 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.


--
Claudia Beleites
Spectroscopy/Imaging
Institute of Photonic Technology
Albert-Einstein-Str. 9
07745 Jena
Germany

email: [hidden email]
phone: +49 3641 206-133
fax:   +49 2641 206-399

______________________________________________
[hidden email] 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.