Re: [R] need help with withRestarts ?

2014-12-06 Thread ce
rom: "Chel Hee Lee" [chl...@mail.usask.ca] Date: 12/06/2014 10:29 PM To: "Martin Morgan" , "ce" , r-help@r-project.org Subject: Re: [R] need help with withRestarts ? I am very happy to see the message replied by Martin Morgan. He provides an example how to use the f

Re: [R] need help with withRestarts ?

2014-12-06 Thread Chel Hee Lee
I am very happy to see the message replied by Martin Morgan. He provides an example how to use the function 'withRestarts()'. I personally like his approach; however, the function 'tryCatch()' evaluates the first argument 'expression'. That's, this function can be placed on anywhere. It see

Re: [R] need help with withRestarts ?

2014-12-06 Thread Martin Morgan
On 12/06/2014 02:53 PM, ce wrote: Dear all, Let's say I have this script , below. tryCatch indeed catches the error but exists, I want function to continue and stay in the loop. I found very examples of withRestarts on internet to figure it out. Could you help me how to do it ? myfunc <-

[R] need help with withRestarts ?

2014-12-06 Thread ce
Dear all, Let's say I have this script , below. tryCatch indeed catches the error but exists, I want function to continue and stay in the loop. I found very examples of withRestarts on internet to figure it out. Could you help me how to do it ? myfunc <- function() { while(1) { x <- r