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. Is that possible? Thanks, in advance Pablo Yabo
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/
have you considered "try"? hope this helps. spencer graves 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. >Is that possible? > >Thanks, in advance > >Pablo Yabo > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://www.stat.math.ethz.ch/mailman/listinfo/r-help > >