Displaying 20 results from an estimated 5000 matches similar to: "tryCatch in on.exit()"
2010 Nov 16
2
Debugging segfault in foreach
Hi,
I'm using R-2.12 on a linux 64bit machine.
When I run a chunk of code inside a foreach() %do% { ...} or %dopar%
{...} (with doMC backend) I keep getting a segfault. Running the
*same* code within lapply(something, function(x) ... ) doesn't result
in any segfaults. I'll paste the output below, but I'm not sure it
would be helpful.
I'm more curious how to go about smoking
2017 Dec 01
0
tryCatch in on.exit()
Thanks -- will look into it.
luke
On Fri, 1 Dec 2017, William Dunlap via R-devel wrote:
> The following example involves a function whose on.exit()
> expression both generates an error and catches the error.
> The body of the function also generates an error.
>
> When calling the function wrapped in a tryCatch, should
> that tryCatch's error function be given the error
2011 Nov 09
3
Help with tryCatch with a for loop
Hello all,
I'm a beginner in R working on a script that will produce a set of models
(linear, polynomial and logistic) for each location in a dataset. However,
the self-starting logistic model often fails - if this happens I would like
to just skip to the next iteration of the loop using tryCatch.
I've looked at a few examples and read the help file, but didn't understand
tryCatch
2016 May 04
4
Is it possible to retrieve the last error? (not error *message*)
Hi,
at the R prompt, is it possible to retrieve the last error (as in
condition object of class "error")?
I'm not asking for geterrmessage(), which only returns the error
message (as a character string). I'm basically looking for a
.Last.error or .Last.condition, analogously to .Last.value for values,
which can be used when it is "too late" (not possible) to go back
2005 Sep 07
1
Tracebacks with tryCatch() and withCallingHandlers()?
When batch processing analysis, I use tryCatch() for failure handling
and to prevent unwanted interrupts. I write detailed progress to log
file and conditions (warnings and errors) are written to the same log
file immediately by using withCallingHandlers(..., condition=function(c)
cat(c, file=logFile)). However, I would also like to write the call
stack to the log file to further simplify
2009 Mar 20
1
sprintf causes a segfault (PR#13613)
Full_Name: Wacek Kusnierczyk
Version: 2.8.0 and 2.10.0 r48163
OS: Ubuntu 8.04 Linux 32bit
Submission from: (NULL) (129.241.198.172)
the following code illustrates a problem with sprintf which consistently causes
a segfault when applied to certain type of arguments. it also shows
inconsistent consequences of the segfault:
(e = tryCatch(stop(), error=identity))
# e is an error object
2012 May 15
1
KEGGSOAP installation error
Hello,
I'm trying to install KEGGSOAP with bioconductor but i'm facing this
problem:
/> biocLite("KEGGSOAP")
BioC_mirror: http://bioconductor.org
Using R version 2.15, BiocInstaller version 1.4.4.
Installing package(s) 'KEGGSOAP'
trying URL
'http://www.bioconductor.org/packages/2.10/bioc/src/contrib/KEGGSOAP_1.30.0.tar.gz'
Content type
2009 Jan 07
1
Compiling R for Solaris 10 Intel
Hi,
I downloaded 2.8.1 and tried to compile it using gcc 3.4.6. (simple install, just ./configure, make, make check, make install)
I found that it compiled and went through the tests fine.
The foreign library, however, that seems to be segfaulting on me (see output below). I did see an old posting about a similar problem, but there was no resolution. Have other people experienced this at all?
2013 Jun 07
1
cannot load pbdMPI package after compilation
Hello,
I try to install pbdMPI.
Compilation successful, but load fails with segfault.
Is anyone can help me?
R version 3.0.0
pbdMPI version 0.1-6
Intel compiler version 13.1.1
OpenMPI version 1.6.4-1
CPU Intel x86_64
# R CMD INSTALL pbdMPI_0.1-6.tar.gz
..
....
checking for gcc... icc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name...
2018 Feb 21
1
Checking for a proper "stop" statement...
Folks:
Consider the following two use cases:
goodfunction <- function()
{
stop("Something went wrong..."
}
# vs.
badfunction <- function()
{
notgood()
}
Is there a way for me to test if the functions make use of a stop()
statement WITHOUT modifying the stop() output (assume I can't mod the
function containing the stop() statement itself)? For "goodfunction" the
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
2005 Oct 31
2
Help with try or tryCatch
I am having trouble with try and tryCatch.
I have read the documentation but I just don't get it.
Here is what I am trying to do. I am testing a function which has a number
of parameters. I want to test it for different values of the parameters
and I have some loops, in the middle of which is a test of the function.
Sometimes the routine fails and so I have put the bit that might fail
2013 Mar 19
1
source, sys.source and error line numbers
Hi,
is there a way to retrieve the line number of where en error occurred when
sourcing a file in a tryCatch statement? Is it stored somewhere accessible?
It is not found in the error object.
Consider the following code/output and note the difference in the traceback
between source (has line number) and sys.source (has no line number).
Thank you,
Renaud
########
# code
########
codefile <-
2018 Sep 19
5
segfault issue with parallel::mclapply and download.file() on Mac OS X
I have an lapply function call that I want to parallelize. Below is a very
simplified version of the code:
url_base <- "https://cloud.r-project.org/src/contrib/"
files <- c("A3_1.0.0.tar.gz", "ABC.RAP_0.9.0.tar.gz")
res <- parallel::mclapply(files, function(s) download.file(paste0(url_base,
s), s))
Instead of download a couple of files in parallel, I get a
2019 Mar 02
1
stopifnot
A private reply by Martin made me realize that I was wrong about
stopifnot(exprs=TRUE) .
It actually works fine. I apologize. What I tried and was failed was
stopifnot(exprs=T) .
Error in exprs[[1]] : object of type 'symbol' is not subsettable
The shortcut
assert <- function(exprs) stopifnot(exprs = exprs)
mentioned in "Warning" section of the documentation similarly fails
2023 May 18
1
suprising behaviour of tryCatch()
G'day Federico,
On Wed, 17 May 2023 10:42:17 +0000
"Calboli Federico (LUKE)" <federico.calboli at luke.fi> wrote:
> sexsnp = rep(NA, 1750)
> for(i in 1:1750){tryCatch(sexsnp[i] = fisher.test(table(data[,3],
> data[,i + 38]))$p, error = function(e) print(NA))} Error: unexpected
> '=' in "for(i in 1:1750){tryCatch(sexsnp[i] ="
Try:
R> for(i in
2011 Jul 10
1
Help with tryCatch
Having a hard time understanding the help files for tryCatch. Looking for a
little help with the following statement which sits inside a for loop
zest[i] <- tryCatch(sapply(getNodeSet(zdoc, "//zestimate/amount"),
xmlValue), error=function() zest[i] <-"NA")
zest is a numeric vector
If the sapply statement evaluates to an error, I'd like to set the value of
zest[i]
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
2010 Feb 08
2
Error on start R in server
Hello all,
(Thank for your reply)
I have a web-application in Apache Tomcat, when i start R in this
application,
I used packe RSJava
Code
ROmegahatInterpreter interp;
String [] rargs = {"--no-save"};
REvaluator e;
interp = new ROmegahatInterpreter (
ROmegahatInterpreter.fixArgs(rargs),false );
e =new REvaluator ();
Errors
================
R version 2.10.1 (2009-12-14)
2011 Mar 10
1
tryCatch - Continuing for/next loop after error
Dear all,
I am not sure I understand fully the functionality of "tryCatch" and
"try" commands and how these are used to continue a for/next loop if an
error occurs within the loop.
Can somebody point me to material (or share some code) with more
extensive examples than the ones in the help/FAQ pages?
Do explain my problem in more detail:
for (i in 100:1000)
{
## do