[R] Exception Handling

From: Tudor Bodea <gtg757i_at_mail.gatech.edu>
Date: Sun, 06 Jul 2008 19:36:35 -0400


Dear useRs:

Please provide me with your thoughts on an issue related to the design of a production level system. For example, let’s suppose that I need to run the same R script for a finite sequence of items (e.g., in the energy industry, I may need to asses the profitability of all gas stations in the state of Florida). For each of the items, the R script accesses some remote databases, gets all the necessary information and processes the data locally. If the data for every item in the item list were not corrupted then the R script would easily do its job. However, every now and then, the data for some items is partially missing and the R script returns in such cases an error message
(e.g., for a given gas station, 1 month worth of data is missing from a 3
month decision horizon). As of right now, using the error option of options
(), whenever an exception happens, the R script sends me an email error
message and kills the current R instance. As I already figured it out, this is not necessarily the most efficient way to deal with such exceptions. Ideally, I would like the script to inform me of the data problem but continue the analysis with the remaining of the items. Based on my searches, I believe that try / stop can answer my problem. However, if any of you already implemented such a safe fail system I would really appreciate your taking the time to (1) share with me what you think constitutes the best practices and/or
(2) point out to me any online material relevant to the topic. I run various
versions of R on Windows and multiple UNIX platforms. The list of items is read from a .csv file and stored in a dataframe.

Thank you.

Tudor

--
Tudor Dan Bodea
Georgia Institute of Technology
School of Civil and Environmental Engineering
Web: http://www.prism.gatech.edu/~gtg757i

______________________________________________
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.
Received on Sun 06 Jul 2008 - 23:41:27 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 07 Jul 2008 - 13:31:45 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive