Displaying 20 results from an estimated 800 matches similar to: "Suggestion: Add simpleExit condition"
2006 Mar 14
1
New simpleExit() condition (Was: Re: Can example() code stop the example without generating an error?)
On 3/14/06, Uwe Ligges <ligges at statistik.uni-dortmund.de> wrote:
> Henrik Bengtsson wrote:
>
> > 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
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?
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(
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
2017 Jan 04
0
cat(s, file): infinite loop of "invalid char string in output conversion" warnings with UTF-8 encoding
The below code snippet gives a single warning:
Warning message:
In cat(s, file = tempfile()) : invalid char string in output conversion
when n <= 10001, whereas with n >= 10002 it appears to be generating
the same warning in an infinite loop in the call to cat().
n <- 10002L
r <- raw(length = n)
r[] <- charToRaw(" ")
r[length(r)] <- as.raw(0xa9)
s <-
2015 Sep 10
2
Using IDs to suppress specific messages and warnings
The suppressMessages and suppressWarnings functions currently suppress
all the message or warnings that are generated by the input
expression.
The ability to suppress only specific messages or warnings is
sometimes useful, particularly for cases like file import where there
are lots of things that can go wrong.
Suppressing only messages that match a regular expression has rightly
been rejected
2010 Dec 05
1
How to catch both warnings and errors?
Dear expeRts,
I am struggling with warning/error handling.
I would like to call a function which can produce either
a) normal output
b) a warning
c) an error
Since the function is called several (thousand) times in a loop, I would like
to proceed "quietly" and collect the warnings and errors [to deal with them at a
later point].
I have seen constructs with tryCatch (which can
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
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,
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'
2015 Sep 10
0
Using IDs to suppress specific messages and warnings
Conditions have classes and the condition system is designed around
the idea that classes would be used for this sort of thing. That is
already how tryCatch and withCallingHandlers discriminate the
conditions to handle.
Designing and implementing a condition class hierarchy to support this
is indeed the hard/tedious part.
Best,
luke
On Thu, 10 Sep 2015, Richard Cotton wrote:
> The
2023 Apr 30
0
Forcing a PROTECT Bug to Occur
On 4/30/23 06:05, Michael Milton wrote:
> Hi Tomas, thanks for the reply.
>
> I played with some of the factors you mentioned like allocating more
> INTSXP of the same size as vec_1, to little success. The thing that
> actually "worked" and caused a segfault, was simply allocating a
> larger vector the first time. 100 elements seemed to do it, but 10 or
> less
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
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
2005 May 10
1
wish: print.condition and html (PR#7848)
Full_Name: Tom Short
Version: 2.1.0
OS: Win2000
Submission from: (NULL) (68.236.159.160)
print.condition prints out error messages enclosed in angle brackets as in:
> simpleError("Sigh, yet another error...")
<simpleError: Sigh, yet another error...>
If R is used to generate HTML output (R2HTML or Rpad), then the error messages
get hidden because browsers will skip right
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:
> {
+
2015 Sep 10
2
Using IDs to suppress specific messages and warnings
Thanks Luke,
On 10 September 2015 at 14:47, <luke-tierney at uiowa.edu> wrote:
> Conditions have classes and the condition system is designed around
> the idea that classes would be used for this sort of thing. That is
> already how tryCatch and withCallingHandlers discriminate the
> conditions to handle.
That makes sense. Though with my sqrt example, it's just a plain
2010 May 29
3
simpleError in storage.mode(y)
bonjour en travaillant avec un logiciel Multiple source methode, j'ai eu ce
message d'erreur : simpleError in storage.mode(y) - "double": invalid to
change the storage mode of a factor
en recherchant sur le net , c'est un message universel
svp, que signifiera ce message ?
merci pour votre int?r?t
anzid
--
View this message in context:
2020 Aug 31
1
make check fails due to NA / NaN mismatch
Thank you for the introduction to these recent changes, Martin.
I think this was the second time I ran "make check" on that platform (Raspberry Pi 32-bit), and the first time (some months ago) it worked fine. So, that makes it kind of "suddenly", although I must say that my use of "make check" is very irregular.
I compared code before and after the split you are
2005 Aug 22
1
Fetching Warning Messages
Hi,
I am facing one problem of fetching R warning messages in Java Code
using Rserve. It is easier to trap R Error messages by using catching
RSrvException. I came to know one way of fetching R Warning messages, i.e.
using "withCallingHandlers", below is my Java Program, which uses
withCallingHandlers of R :
import org.rosuda.JRclient.*;