Displaying 20 results from an estimated 10000 matches similar to: "help: error handling in try"
2018 Feb 22
2
Problem with geterrmessage()
Luke
Thanks ? I revised the code to:
ERRORMESSAGE <- try(source(USERSCRIPTFILE, local=T), silent=T)
print(ERRORMESSAGE) now returns:
$value
[1] 0
$visible
[1] FALSE
Not clear what to make of that.
Dennis
Dennis Fisher MD
P < (The "P Less Than" Company)
Phone / Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com
> On Feb 22, 2018, at 12:45 PM, luke-tierney at
2018 Feb 22
0
Problem with geterrmessage()
Only the default error handler puts the error message in a buffer
where it can be retrieved with geterrmessage. try() replaces the
default error handler. Either look at the value returned by try() or
use tryCatch with conditionMessage.
Best,
luke
On Thu, 22 Feb 2018, Dennis Fisher wrote:
> R 3.4.3
> OS X
>
> Colleagues
>
> I have a 20K line script in which I encounter an
2018 Feb 22
2
Problem with geterrmessage()
R 3.4.3
OS X
Colleagues
I have a 20K line script in which I encounter an unexpected problem.
If the script detects presence of a particular file USERCODE.txt, it executes:
source(?USERCODE.txt?)
If that file is not present, the script executes without a problem.
There might be syntax errors in USERCODE.txt; therefore, the code above is embedded in a try command:
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?
2007 Dec 10
1
Building R on Sun Solaris 10 (SPARC) using Sun Studio 12
R Help List:
Just curious if anyone has successfully built R on a SPARC
platform running Sun Solaris 10 using the latest Sun Studio
12 set of compilers. If so, I would be interested in the
compile flags that you used.
I have tried several different builds of version 2.5.1, 2.6.0,
and 2.6.1 using various different compile flags and I am able
to compile and check, but for whatever reason, the
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
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
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
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)
2009 Sep 17
3
Simple as.Date question dealing with a timezone offset
I've been trying to understand the as.Date functionality and I have a date
and time stamp field that looks like this:
"Tue Sep 15 09:22:09 -0600 2009"
and I need to turn it into an R Date object for analysis.
Simple date conversions I have down, no problem:
> adate = c("7/30/1959")
> as.Date(adate,"%m/%d/%Y")
[1] "1959-07-30"
>
But when it
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...
2010 Nov 09
1
R-2.12.0 problem on Solaris 10
It's been a few days I cannot compile to get R-2.12.0 working at sparc Solaris 10. Seems the R software installation is OK, but the recommended package called Matrix stopped me, since I can finish the installation with the configure option -with-recommended-packages=no. I then run
Ø Install.packages("Matrix")
Then last few lines of output are the following,
28: tryCatch(expr,
2004 Mar 11
2
No traceback available when using try(...)
Hello,
1. The Situation :
------------------------
The stack traceback is not available when error ouccured in a try(....)
-- test.R --------------------------------
f<-function(a){
return ( log(a) )
}
try(f("A"))
traceback()
-------------------------------------------
I get the following message :
> try(f("A"))
Error in log(x) : Non-numeric argument to mathematical
2008 Mar 12
1
gracefully handing a library load error
I have an R program I am attempting to use to generate some SVGs. I've been
using the cairoDevice library. When running a session not connected to an X
session (like if I'm sshed in), attempting "library(cairoDevice)" causes:
*** caught segfault ***
address 0x8, cause 'memory not mapped'
Traceback:
1: .C("R_gtk_setEventHandler", PACKAGE =
2009 Dec 30
1
seg-fault... but on what
I got the following after running succesfully through this loop 28 million
times... the loop opens text files in a directory and inserts line by line
into a database...
*** caught segfault ***
address 0xc0000010, cause 'memory not mapped'
Traceback:
1: .getGeneric(f, where, package)
2: getGeneric("coerce", where = where)
3: as(obj, "integer")
4:
2019 Jun 08
2
Determining the exit code of an "almost finished" R script
Dear All,
I'm using "reg.finalizer" in a function that is to be called in R scripts
to do some cleanup on success. I have not found a way to run the function
only if the script run without errors, so when the exit code is expected to
be 0.
What I've tried is checking "geterrmessage()", but unfortunately it's not
perfect: if an error was handled with eg
2012 Feb 06
1
Segfault on ".C" registration via R_CMethodDef according to 'Writing R Extensions'.
Dear R List,
I encountered a serious problem regarding the registration of ".C" when following the documentation "Writing R Extensions"
that leads to a segmentation fault (tested on windows and mac os x).
The registration mechanism for ".C" routines via R_registerRoutines and
the R_CMethodDef structure has been enhanced recently with the
addition of two fields, one
2010 Mar 25
1
*** caught segfault *** address 0x18, cause 'memory not mapped'
Hello R Community,
I've been run the following codes. However, I've been getting an
unusual segfault
that I'm unable to trace its origin. Please give me a light to
decipher the "caught segfault"
Thanks for you attention.
Bernardo.
> options(STERM='iESS', editor='emacsclient')
> rm(list = ls())
> > source("fgenIGLD.R") #RNG
2012 Feb 23
1
segfault when using data.table package in conjunction with foreach
Hi all,
I'm trying to use the package read.table within a foreach loop. I'm
grabbing 500M rows of data at a time from two different files and then
doing an aggregate/tapply like function in read.table after that. I
had planned on doing a foreach loop 39 times at once for the 39 files
I have, but obviously that won't work until I figure out why the
segfault is occurring. The
2012 Apr 03
1
rpart error message
Hi R-helpers,
I am using rpart package for decision tree using R.We are invoking R
environment through JRI from our java application.Hence, the result of R
command is returned in REXP and we use geterrMessage() to retrieve the
error.
When we execute the following command,
cnr_model<-rpart(as.factor(Species)~Sepal Length+Sepal Width+Petal Length,
method="class",