sagarnikam123
2012-Mar-23 07:32 UTC
[R] how to know perfect execution of function ? & if error occurred in execution, how to report it?
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.
Jim Holtman
2012-Mar-23 09:29 UTC
[R] how to know perfect execution of function ? & if error occurred in execution, how to report it?
?try Sent from my iPad On Mar 23, 2012, at 3:32, sagarnikam123 <sagarnikam123 at gmail.com> 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. > > ______________________________________________ > R-help at 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.
Claudia Beleites
2012-Mar-23 10:04 UTC
[R] how to know perfect execution of function ? & if error occurred in execution, how to report it?
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 <sagarnikam123 at gmail.com> 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. >> >> ______________________________________________ >> R-help at 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. > > ______________________________________________ > R-help at 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.-- Claudia Beleites Spectroscopy/Imaging Institute of Photonic Technology Albert-Einstein-Str. 9 07745 Jena Germany email: claudia.beleites at ipht-jena.de phone: +49 3641 206-133 fax: +49 2641 206-399