Learn R Programming

erratum (version 2.2.0)

ew: Handlers

Description

Handle errors and warnings.

Usage

e(obj)

w(obj)

Arguments

obj

A character string or an object of class error, or warning.

Examples

Run this code
# NOT RUN {
err <- e("Something went wrong")

foo <- function(x){
 if(is.character(x))
   return(err)

 log(x)
}

foo("a")

# }

Run the code above in your browser using DataLab