Try blocks in R for error handling

R scripts halt execution when an error is encountered.  When batch processing this produces situations where the error can not be merely skipped like it could in a .net application with  user involvement. To use Try() blocks for error handling in R, enclose the entire block of code in a try() block.

# Do some stuff here
png(filename=args[3], width=900, height=300)
# some more code here...
This entry was posted in Blog and tagged , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Leave a Reply