Hi, I am thinking about awareness of errors when an R script runs. My concern is I have an error-free script. I run it for months on end without problems. Then, something changes somewhere causing an error. My wonderment is how R will tell me I had an error in the script, but the rest of the script ran without impairment. QUESTIONS What are some of the more helpful options available to an R developer to capture errors in a script run? What are some of the best processes to implement these more helpful options? Thanks, -- *Stephen Dawson, DSL* /Executive Strategy Consultant/ Business & Technology +1 (865) 804-3454 http://www.shdawson.com <http://www.shdawson.com>
?tryCatch This list is not meant for tutorials. A web search on "find errors in R code" brought up what appeared to be many resources to address your question. Please make use of such resources before posting here. Also, please read and follow the posting gui)de linked below to find out what sort of help you can expect (and have already received here. Cheers, Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Thu, Dec 23, 2021 at 3:14 AM Stephen H. Dawson, DSL via R-help <r-help at r-project.org> wrote:> > Hi, > > > I am thinking about awareness of errors when an R script runs. > > My concern is I have an error-free script. I run it for months on end > without problems. Then, something changes somewhere causing an error. My > wonderment is how R will tell me I had an error in the script, but the > rest of the script ran without impairment. > > QUESTIONS > What are some of the more helpful options available to an R developer to > capture errors in a script run? > > What are some of the best processes to implement these more helpful options? > > > Thanks, > -- > *Stephen Dawson, DSL* > /Executive Strategy Consultant/ > Business & Technology > +1 (865) 804-3454 > http://www.shdawson.com <http://www.shdawson.com> > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.
You want to read this: http://adv-r.had.co.nz/Exceptions-Debugging.html It describes all the ways that R can report a problem and all the ways you can catch such a report while still in R. Let me heartily recommend the whole site, or better yet, the book https://www.amazon.com/dp/0815384572/ref=cm_sw_su_dp?tag=devtools-20 On Fri, 24 Dec 2021 at 00:14, Stephen H. Dawson, DSL via R-help < r-help at r-project.org> wrote:> Hi, > > > I am thinking about awareness of errors when an R script runs. > > My concern is I have an error-free script. I run it for months on end > without problems. Then, something changes somewhere causing an error. My > wonderment is how R will tell me I had an error in the script, but the > rest of the script ran without impairment. > > QUESTIONS > What are some of the more helpful options available to an R developer to > capture errors in a script run? > > What are some of the best processes to implement these more helpful > options? > > > Thanks, > -- > *Stephen Dawson, DSL* > /Executive Strategy Consultant/ > Business & Technology > +1 (865) 804-3454 > http://www.shdawson.com <http://www.shdawson.com> > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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. >[[alternative HTML version deleted]]
On 12/23/21 3:11 AM, Stephen H. Dawson, DSL via R-help wrote:> Hi, > > > I am thinking about awareness of errors when an R script runs. > > My concern is I have an error-free script. I run it for months on end > without problems. Then, something changes somewhere causing an error. > My wonderment is how R will tell me I had an error in the script, but > the rest of the script ran without impairment. > > QUESTIONS > What are some of the more helpful options available to an R developer > to capture errors in a script run? > > What are some of the best processes to implement these more helpful > options?See this insight from Spencer Graves from Feb 2011 on Rhelp: https://stat.ethz.ch/pipermail/r-help/2011-February/268512.html> > > Thanks,