[R] Exception handling

Jonathan Baron baron at psych.upenn.edu
Sun Jan 4 00:05:47 CET 2004


On 01/03/04 19:58, Pablo Yabo wrote:
>Hi,
>I want to know if it's possible to prevent that a stop call stops my
>program.
>I want to call a function that can fail calling a stop. But in that case I
>want to keep the control and do something else, not stop the program and
>print a message.

Perhaps something like:

if (CONDITION) {stop("ERROR MESSAGE")} else {DO SOMETHING ELSE}

or just

if (CONDITION) {stop("ERROR MESSAGE")}

and the do something else comes later.

Jon
-- 
Jonathan Baron, Professor of Psychology, University of Pennsylvania
Home page:            http://www.sas.upenn.edu/~baron
R page:               http://finzi.psych.upenn.edu/




More information about the R-help mailing list