tryCatch() - The smart way for new tries

Hello, Guys!

Could you tell me the smart way for this? I want it to make some new tries while it returns an error.

erro<<-TRUE
maximo<<-1
while (erro & maximo <= 10)
{
erro<-FALSE
tryCatch({
if (maximo < 20)
A<-2+"two" #make error
else
A<-3+3 #dont make erro
},
error=function(e){
erro<<-TRUE
print(e)
})
maximo <<- maximo+1
}

Thank You!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.