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...


Leave a Reply