Displaying 20 results from an estimated 400 matches similar to: "No traceback available when using try(...)"
2005 Nov 23
2
TryCatch() with read.csv("http://...")
Hi, folks!
I'm trying to pull in data using read.csv("my URL goes here"), and it really
works fantastically. Amazing to pull in live data right off the internet,
into RAM, and get busy...
however...
occasionally there is a server problem, or the data are not up yet, and
instead of pushing through a nice CSV file, the server sends a 404 "Not
Found" page...
Since the
2012 Sep 11
1
Is invokeRestart("abort") unstoppable?
Hi,
I'm trying to implement an abort() method that works just like stop()
but does not signal the condition such that try() and tryCatch(...,
condition=...) are, contrary to stop(), effectively non-working with
abort() calls.
In order to achieve this, I stumbled upon invokeRestart("abort"), cf.
help("invokeRestart", package="base") that reads "Restarts are
2004 Mar 12
1
Re: [R] No traceback available when using try(...) (PR#6667)
On Fri, 12 Mar 2004 12:28:48 +0100, Edouard DUCHESNAY
<duchesnay@shfj.cea.fr> wrote :
>> > 1. The Situation :
>> > ------------------------
>> > The stack traceback is not available when error ouccured in a try(....)
>>
>> It's a bug in 1.8.1. It has been fixed.
>>
>> -thomas
>I have patched R (Version 1.8.1 Patched (2004-03-11))
2004 Mar 12
0
Re: [R] No traceback available when using try(...) (PR#6668)
Funny, it works for me on R-patched
> f <- function(a) { return(log(a)) }
> f("A")
Error in log(x) : Non-numeric argument to mathematical function
> traceback()
2: log(a)
1: f("A")
> try(f("A"))
Error in log(x) : Non-numeric argument to mathematical function
> traceback()
2: log(a)
1: f("A")
This is on
> version
_
2012 Oct 21
1
suppress *specific* warnings?
Not desperately important, but nice to have and possibly of use to
others, is the ability to suppress specific warnings rather than
suppressing warnings indiscriminately. I often know of a specific
warning that I want to ignore (because I know that's it's a false
positive/ignorable), but the current design of suppressWarnings() forces
me to ignore *any* warnings coming from the
2019 Feb 24
1
stopifnot
>From https://github.com/HenrikBengtsson/Wishlist-for-R/issues/70 :
... and follow up note from 2018-03-15: Ouch... in R-devel, stopifnot() has become yet 4-5 times slower;
...
which is due to a complete rewrite using tryCatch() and withCallingHandlers().
>From https://stat.ethz.ch/pipermail/r-devel/2017-May/074256.html , it seems that 'tryCatch' was used to avoid the following
2012 Feb 03
1
Resume processing after warning handler.
Dear list!
I have a script that processes a large number of data files. When one
file fails to process correctly, I want the script to write a message
and to continue with the next file. I achieved this with tryCatch:
for (f in files)
tryCatch({heavy.lifting(f)}, error=function(e) log.error.to.file(e))
I also want to log warning messages and tried something like this:
for (f in
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
2010 Aug 27
1
introspective capabilities
Hi,
Is there any way, from R code, to perform introspection as to where
certain names acquired their values? The specific functionality I'm
looking for in this case is to be able to request my editor to view the
definition corresponding to a name in its original source location
(presuming for the moment that that location exists). Other
functionality that I'm looking for is to identify
2003 Nov 19
2
Was: setValidity and "initialize" method conflict ? [in R-help]
Hello,
Thomas Stabla (statho3@web.de) has already sent this
question to R-help, Wed, 12 Nov 2003 21:21:31 +0100,
but we are not sure whether we should better post this
mail to this audience than to R-help:
---------------------------------------------------------------------
We are using S4-classes and want to force a validity check
when an object is created.
How can this be done, when an
2019 Feb 27
1
stopifnot
My points:
- The 'withCallingHandlers' construct that is used in current 'stopifnot' code has no effect. Without it, the warning message is the same. The overridden warning is not raised. The original warning stays.
- Overriding call in error and warning to 'cl.i' doesn't always give better outcome. The original call may be "narrower" than 'cl.i'.
I
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 May 05
1
help with restart
Dear all, I want to download webpage from a large number of webpage.
For example,
########
link <- c("http://gzbbs.soufun.com/board/2811006802/",
"http://gzbbs.soufun.com/board/2811328226/",
"http://gzbbs.soufun.com/board/2811720258/",
"http://gzbbs.soufun.com/board/2811495702/",
"http://gzbbs.soufun.com/board/2811176022/",
2012 Feb 03
1
GAM (mgcv) warning: matrix not positive definite
Dear list,
I fitted the same GAM model using directly the function gam(mgcv) ... then
as a parameter of another function that capture the warnings messages (see
below).
In the first case, there is no warning message printed, but in the last
one, the function find two warning messages stating "matrix not positive
definite"
So my question is: Do I have to worry about those warnings and
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
2013 Apr 18
1
Suppress specific warnings
Hello,
is there a convenient way to suppress only *specific* warnings? (I know about ?suppressWarnings)
I depend on another package, from which I want to suppress only some warnings, but not others.
Felix
2011 Feb 18
2
How to flag those iterations which yield a warning?
Hi,
I am running a simulation study with the survival::coxph. Some of the simulations result in problematic fits due to flat partial likelihood. So, you get the warning message:
Warning message:
In fitter(X, Y, strats, offset, init, control, weights = weights, ... :
Loglik converged before variable 2 ; beta may be infinite.
How can I keep track of the simulations which yield any kind of
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 =
2012 Feb 07
1
lme, lmer, convergence
Hello, all,
I am running some simulations to estimate power for a complicated epidemiological study, and am using lme and lmer to get these estimates. I have to run a few thousand iterations, and once in a great while, an iteration will create fake data such that the model won't converge. I see from Google searches that this is not an uncommon situation.
My question: is there a way to