search for: simpleexit

Displaying 4 results from an estimated 4 matches for "simpleexit".

2006 Mar 14
1
New simpleExit() condition (Was: Re: Can example() code stop the example without generating an error?)
...point. The purpose is to keep the code clean and I want to avoid nested if statements. Further conditions down the stream would make the code quite ugly. Pretty much for the same reason you use 'return()' and 'break'. A nicer and more general solution is to have a subclass "simpleExit" of "simpleCondition" and make source() catch such signals via tryCatch(..., simpleExit=function(se) {...}). Here is a complete example: simpleExit <- function(...) { cond <- simpleCondition(...) class(cond) <- c("simpleExit", class(cond)) cond } exit <...
2007 Aug 27
0
Suggestion: Add simpleExit condition
...know this can be solved by a simple if {require("foo")} { } statement, but the above is to avoid such nested code, especially in example code, cf. return() and break. Here are the details to get this working: 1. Define a new condition class similar to simpleWarning() and simpleError(): simpleExit <- function(...) { cond <- simpleCondition(...) class(cond) <- c("simpleExit", class(cond)) cond } 2. Setup a method to generate such a condition similar to warning() and stop(): exit <- function(...) { invisible(signalCondition(simpleExit(...))) } } 3. That is the...
2009 Nov 28
1
Sending signals to current R process from R running under MS Windows (c.f. Esc)
I am using RGtk2 for a simple GUI (rattle). I start rattle from the RGui and I remain able to interact with the RGui while rattle runs. Under MS/Windows, when rattle has initiated some other underlying R command the rattle GUI remains responsive (unlike under GNU/Linux where it is not responsive until the underlying command completes). I can interrupt the running command with a press of the Esc
2006 Mar 18
1
The R "fork"
Hello, I would like to call a function that can take infinite time to be executed in some circumstances (which can not be easily detected). So, I would like that once the function is being executed for more than two seconds it is stopped. I have found documentation for timers but i did not found how to "kill" a function. Moreover, I would like not to change the function code (it should