To handle warnings or errors one can use
result = tryCatch({ expr }, warning = function(w) { warning-handler-cod