similar to: New simpleExit() condition (Was: Re: Can example() code stop the example without generating an error?)

Displaying 20 results from an estimated 1400 matches similar to: "New simpleExit() condition (Was: Re: Can example() code stop the example without generating an error?)"

2007 Aug 27
0
Suggestion: Add simpleExit condition
Hi, I would like to bring up and old suggestion [http://tolstoy.newcastle.edu.au/R/devel/06/03/4512.html] of adding an exit condition, so that for instance it is possible to silently exit from scripts and Rd examples similar to return() for functions, e.g. \examples{ require("foo") || exit("Example will not run without the 'foo' package.") ... } I know this can be
2006 Mar 14
1
Can example() code stop the example without generating an error?
Hi, does anyone know if it is possible to write example code (in Rd examples) such that one can stop the example without generating an error? Example: code A if (cond) niceStop() code B I know this sounds weird, but I would like some of my Rd examples to run if and only if another package is available or if a certain large Affymetrix data file is available. One can put all of the example in
2005 Oct 18
0
tryCatch, simpleCondition question
Hi, I'm trying to learn how to use the tryCatch condition system and am confused about the behavior when I set the call arg of a simpleCondition. I want to catch an error if it meets a certain criteria and otherwise reraise it. I want the error message to indicate the function in which the error occured (and not mention tryCatch). Wanted: > g("foo") ## error caught
2013 Feb 07
4
Hard Stop?
is it possible to throw a stop() that is so hard that it will escape even tryCatch? /iaw ---- Ivo Welch (ivo.welch at gmail.com)
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
2007 Feb 19
2
"try"ing to understand condition handling
I'm confused by the page documenting tryCatch and friends. I think it describes 3 separate mechanisms: tryCatch (in which control returns to the invoking tryCatch), withCallHandlers (in which control goes up to the calling handler/s but then continues from the point at which signalCondition() was invoked), and withRestarts (I can't tell where control ends up). For tryCatch the docs say
2018 Jul 28
4
re-throwing an interrupt condition
Anyone knows a way to re-throw a caught interrupt condition, so that it behaves just like the original one? I.e. no error message is printed, but the execution is stopped of course. With just calling stop in the error handler, it prints the error message, or, if there is no error message (like in the original interrupt condition), another error happens. tryCatch(Sys.sleep(100), interrupt =
2009 Apr 14
0
top level condition handlers
Hello, I would like to establish top level condition handlers and restarts, so that I don't explicit calls to withCallingHandlers and withRestarts in many places: For example : > customError function( message ){ err <- simpleError( message ) class( err ) <- c( "customError", class( err) ) err } > withCallingHandlers( { signalCondition(customError(
2018 Jul 28
0
re-throwing an interrupt condition
The internal code does more or less signalCondition(e) ## allows for (another) handler cat("\n") ## cleans up console invokeRestart("abort") ## jump to 'abort' restart if not handled [for back compatibility it also runs the error option code if that is set, but that may go away eventually]. A version of your example: > { +
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
2003 Nov 08
1
signalCondition
Does signalCondition() only work within try-catch blocks? I expected: testSignal <- function() { error <- simpleError("An error!") signalCondition(error) } to do the same thing as testStop <- function() { error <- simpleError("An error!") stop(error) } but testSignal returns NULL without throwing an error. Have I misunderstood something?
2012 Feb 29
0
Alternative to .Internal(.dfltStop(msg, call))?
Hi, I'm looking for a way to generate a "full stop" that will not be caught by signal handlers, cf. .Internal(.dfltStop(msg, call)). RATIONALE: In the R.oo package I have throw() which (leaving out some details) basically does what stop() does but appends a stack trace string to the error message that shows up at the R prompt. Example: bar <- function() throw("A foo
2013 Feb 01
1
Was confused with options(error = expression(NULL)) in example(stop)
In example for function 'stop' in R, there is options(error = expression(NULL)) with comment # don't stop on stop(.) << Use with CARE! >> I was interested, wanted to know how "don't stop on stop(.)" was. So, I tried it. Typing example(stop) at the R prompt and pressing ENTER give this. > example(stop) stop> options(error = expression(NULL))
2008 Aug 27
1
S4 coercion
I am extending a DBI connection by setClass("TSPostgreSQLConnection", contains=c("PostgreSQLConnection","TSdbOptions")) but the first time I use this I am getting a warning when it tries to coerce the TSPostgreSQLConnection to a PostgreSQLConnection. After the first use the warning stops, but the first warning is causing me problems when I do automatic checks
2008 Jun 03
1
R-2.7.0 make check failure
Hello, I am fairly new to using R and am trying to install it on my Linux machine, running Scientific Linux. I get through running 'configure' and 'make' OK, but when I run 'make check', I get the following error: make check make[1]: Entering directory `/home/gruchti/Programs/R-2.7.0/tests' make[2]: Entering directory `/home/gruchti/Programs/R-2.7.0/tests'
2023 Feb 19
2
R: determine if `suppressMessages()` has been invoked
Awesome, this gets the job done. To answer your question: When using C or C++ via Rinside or within a package, those functions do not listen to suppressMessages, e.g. `Rprintf` keeps printing to the console. Since it's common to use wrapper functions in R anyway, they can run `are_messages_suppressed` and pass the information on to an explicit `verbose` argument of the C / C++ function.
2019 Jun 21
2
Suggested Patch: Library returns matching installed packages when typo present
Hi Luke, Thank you for your response. On 6/21/19 10:56 AM, Tierney, Luke wrote: Thanks for the suggestion. However I don't think it is the right way to go. I also don't care for what install.packages() does. Signaling a warning and then an error means someone has to catch both the error and the warning, or suppress the warning, in order to handle the error programmatically. I do care
2009 Sep 02
1
Tracebacks & try
Hi all, The help for traceback states: Errors which are caught _via_ 'try' or 'tryCatch' do not generate a traceback, so what is printed is the call sequence for the last uncaught error, and not necessarily for the last error. Is there any way to get a traceback (or something similar) for an error raised inside a try block? Regards, Hadley -- http://had.co.nz/
2017 Jan 02
1
utils::ls.str(): Partial argument name 'digits' to seq() (should be digits.d?)
Should utils::ls.str() be updated as: svn diff src/library/utils/R/str.R Index: src/library/utils/R/str.R =================================================================== --- src/library/utils/R/str.R (revision 71879) +++ src/library/utils/R/str.R (working copy) @@ -622,7 +622,7 @@ args$digits.d <- NULL } strargs <- c(list(max.level = max.level, give.attr = give.attr,
2023 Feb 19
1
R: determine if `suppressMessages()` has been invoked
Hi all, I would like to create a function that detects if suppressMessages has been invoked upon running that same function. I was looking through {https://cran.r-project.org/doc/manuals/r-release/R-ints.html}, but I haven't found an answer. I do not understand **how** suppressMessages works. I have not received an answer on SO