Um texto embutido e sem conjunto de caracteres especificado associado... Nome: n?o dispon?vel Url: https://stat.ethz.ch/pipermail/r-help/attachments/20071220/1027fdd6/attachment.pl
On 20-Dec-07 08:24:40, Milton Cezar Ribeiro wrote:> Dear all, > > I am simulating some regressions in a for() looping and sometimes > occours some error and the R stop my batch processing. I would like do > save the step where the error happned and continue my for() looping. > Is there a way to do that? > > Thanks In Advance. > Miltinhotry() is the simple way: see ?try for some basic details. See also ?tryCatch Example: if(class(temp<-try(log("a")))=="try-error"){ print("Goodbye") } else {print("Hello:");print(temp)} ##Error in log(x) : Non-numeric argument to mathematical function ##[1] "Goodbye" if(class(temp<-try(log(10)))=="try-error"){ print("Goodbye") } else {print("Hello:");print(temp)} ##[1] "Hello:" ##[1] 2.302585 Hoping this helps, Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk> Fax-to-email: +44 (0)870 094 0861 Date: 20-Dec-07 Time: 10:00:30 ------------------------------ XFMail ------------------------------
Its a FAQ: http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-capture-or-ignore-errors-in-a-long-simulation_003f On Dec 20, 2007 3:24 AM, Milton Cezar Ribeiro <milton_ruser at yahoo.com.br> wrote:> Dear all, > > I am simulating some regressions in a for() looping and sometimes occours some error and the R stop my batch processing. I would like do save the step where the error happned and continue my for() looping. > Is there a way to do that? > > Thanks In Advance. > Miltinho > > > > para armazenamento! > > [[alternative HTML version deleted]] > > ______________________________________________ > 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. >
your description is pretty vague, at least for me... it would be very helpful to have the "commented, minimal, self- contained, reproducible code"... but, anyways, you might want to take a look at the try() command. best b On Dec 20, 2007, at 3:24 AM, Milton Cezar Ribeiro wrote:> Dear all, > > I am simulating some regressions in a for() looping and sometimes > occours some error and the R stop my batch processing. I would like > do save the step where the error happned and continue my for() > looping. > Is there a way to do that? > > Thanks In Advance. > Miltinho > > > > para armazenamento! > > [[alternative HTML version deleted]] > > ______________________________________________ > 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.