Thanks - the try() approach is exactly what I need.
Lion Bernard McGarvey Director, Fort Myers Beach Lions Foundation, Inc. Retired (Lilly Engineering Fellow). > On February 27, 2019 at 4:39 PM Robert Knight <bobby.kni...@gmail.com> wrote: > > Some use try blocks, like found in other languages. Put the code you > want to try inside the block. > > https://www.robertknight.io/blog/try-blocks-in-r-for-error-handling/ > contains a quick example. The example doesn’t raise exceptions or anything, > it just contains it for you so the script keeps going. I like handling > errors with if statements inside of try blocks. > > Robert > > > > On Feb 27, 2019, at 2:55 PM, Bernard Comcast < > mcgarvey.bern...@comcast.net mailto:mcgarvey.bern...@comcast.net > wrote: > > > > > What is the recommended way to trap errors in R? My main > need is to be able to trap an error and then skip a section of code if an > error has occurred. In VB for Excel I used the “On Error goto .....” > construct to do this. > > > > Bernard > > Sent from my iPhone so please excuse the spelling!" > > ______________________________________________ > > R-help@r-project.org mailto:R-help@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]] ______________________________________________ R-help@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.