Displaying 20 results from an estimated 100 matches similar to: "error handling"
2015 Aug 21
0
Problems with embedded R, ReplDLL
Along with getting pqR to work on Windows, I've also been testing it
in the context of embedded R, and in the process have found some
problems with the examples given of embedded R use.
One problem can be seen in R_ReplDLLinit, in src/main/main.c:
void R_ReplDLLinit(void)
{
SETJMP(R_Toplevel.cjmpbuf);
R_GlobalContext = R_ToplevelContext = R_SessionContext = &R_Toplevel;
2009 Mar 03
1
profiler and loops
Hello,
(This is follow up from this thread:
http://www.nabble.com/execution-time-of-.packages-td22304833.html but
with a different focus)
I am often confused by the result of the profiler, when a loop is
involved. Consider these two scripts:
script1:
Rprof( )
x <- numeric( )
for( i in 1:10000){
x <- c( x, rnorm(10) )
}
Rprof( NULL )
print( summaryRprof( ) )
script2:
2007 Jul 04
2
problem with findFun call from embedded R
I was debugging a problem reported to me regarding PL/R, and found that
I can duplicate it using only R sources. It might be characterized as
possibly a misuse of the findFun() function, but I leave that for the R
devel experts to decide.
The below results are all with R-2.5.1 (I can't seem to download
r-patched at the moment, but didn't see anything in the 2.5.1-patched
release
2003 Mar 26
0
Rprof/UseMethod
I'm having difficulty with Rprof. I have a documentation example test.qss that
runs fine without profiling, but under Rprof,
> Rprof()
> source("test.qss")
Error in standardGeneric("model.matrix") :
UseMethod used in an inappropriate fashion
Luke wrote about a similar circumstance last summer:
# From: Luke Tierney (luke@stat.umn.edu)
# Date: Fri Jul
2020 Feb 26
1
Profiling: attributing costs to place of invocation (instead of place of evaluation)?
Hi
Consider the following example:
f <- function(expr) g(expr)
g <- function(expr) {
? h(expr)
}
h <- function(expr) {
? expr # evaluation happens here
? i(expr)
}
i <- function(expr) {
? expr # already evaluated, no costs here
? invisible()
}
rprof <- tempfile()
Rprof(rprof)
f(replicate(1e2, sample.int(1e4)))
Rprof(NULL)
cat(readLines(rprof), sep = "\n")
#>
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(
2016 Jun 04
1
RProfmem output format
I'm picking up this 5-year old thread.
1. About the four memory allocations without a stacktrace
I think the four memory allocations without a stacktrace reported by Rprofmem():
> Rprofmem(); x <- raw(2000); Rprofmem("")
> cat(readLines("Rprofmem.out", n=5, warn=FALSE), sep="\n")
192 :360 :360 :1064 :2040 :"raw"
are due to some
2007 Jan 18
0
Emulating a REPL in frontends
A common need in R frontends is to provide some sort of read, (parse),
evaluate, print loop. However, there are also a number of points where
frontends may want to differ from the standard REPL as available e.g. in
R_ReplDLLdo1().
First some thoughts on what is needed, and what is already there, or missing.
If you want to skip over this, a short summary is provided in the second
half, below
2009 Jun 16
1
calling handlers within R_tryEval
Hello,
When using R_tryEval (from JRI in my case), is there a way to setup
error recovery strategy and more generally calling handlers.
From my reading of context.c, R_tryEval calls R_ToplevelExec which
creates a context like this:
begincontext(&thiscontext, CTXT_TOPLEVEL, R_NilValue, R_GlobalEnv,
R_BaseEnv, R_NilValue, R_NilValue);
so I guess what I am trying to do is add
2005 Jun 14
2
Questions about contexts
I'm trying to clarify contexts and their uses. I do have a good
general understanding of them. My question is about "undeclared"
and "non-existant" contexts.
If I have a block somewhere (in sip.conf, for example), and it
has no "context=thiscontext" field, does it just automatically
use the "default" context? Or is this settable? (I see there is
an
2010 Aug 20
2
segfault in embedded r after call to repldlldo1
Dear R developers,
i've got a question concerning an embedded R instance. I called the
initialization routines as seen in the "writing extensions" guide
(Rf_initialize, setup_Rmainloop and R_ReplDLLinit). I also changed the
function callback pointer of readconsole and writeconsoleex to my local
functions.
when i call mainloop there is no problem and the commands are evaluated
2011 Aug 14
0
Improved version of Rprofmem
The Rprofmem facility is currently enabled only if the configuration
option --enable-memory-profiling is used. However, the overhead of
having it enabled is negligible when profiling is not actually being
done, and can easily be made even smaller. So I think it ought to be
enabled all the time.
I've attached a patch doing this, which also makes a number of other
improvements to Rprofmem,
2008 Sep 03
8
suggestion of new API function for embedded programming.
While doing some embedded programming and trying to figure out how to generate
a hand coded SEXP equivalent of the line
"t.test(x,conf.level=(1-p))$conf.int[2]" I had an idea for an addition to the
embedded API.
There are a number of hidden or static parse functions (R_ParseBuffer,
R_Parse1Buffer, etc.) which take an IoBuffer* and returns a parsed tree. If
one or more of these
2006 May 25
1
compiling tests/Embedding
I am compiling the Embedding examples in the tests directory and get an
undefined reference. I include the make output as well as grep'd output
of nm on libR.so and compiler and arch information. Do I have an
improperly built R shared library or is there a problem with the
Embedding tests or something else I am not seeing?
Thanks for any help!
George
ost at
2004 Jun 28
2
Problem with hasArg and the ... argument (PR#7027)
Full_Name: Jelle Goeman
Version: 1.9.0
OS: mingw32, windows 2000
Submission from: (NULL) (145.88.209.33)
Hi Everyone,
I get very strange results using the function hasArg with the ... function
argument. In my own function:
> gt <- globaltest(X,Y)
> sampling(gt)
works fine, but
> sampling(globaltest(X,Y))
results in:
Error in eval(expr, envir, enclos) : "missing"
1997 Aug 05
1
R-beta: Characters in .C
I am having some difficulties using dynamically loaded
C functions on a Sparc 10 with R compiled
using cc (both R-0.49 and R-0.50). I get sporadic errors with the
error message:
Error: character variables must be duplicated in .C/.Fortran,
with C functions which pass character variables.
my C functions look like: anyfunc(char **filename, other variables )
This error message appears about 25%
1997 Aug 05
1
R-beta: Characters in .C
I am having some difficulties using dynamically loaded
C functions on a Sparc 10 with R compiled
using cc (both R-0.49 and R-0.50). I get sporadic errors with the
error message:
Error: character variables must be duplicated in .C/.Fortran,
with C functions which pass character variables.
my C functions look like: anyfunc(char **filename, other variables )
This error message appears about 25%
2002 Jul 19
1
Rprof and setMethod conflict?
I noticed this oddity about R profiling and setMethod.
First, I "test out" Rprof.
> require(methods)
Loading required package: methods
[1] TRUE
>
> Rprof("test.out")
> data.frame("a")
X.a.
1 a
> Rprof(NULL)
So far, so good. Next, I define myClass.
> setClass("myClass", representation(mySlot = "numeric"))
[1]
1999 Sep 07
1
sys.on.exit appears non-functional (PR#269)
As far as I can see sys.on.exit() does not work. The following
will give a non-null result in S, and seems about the simplest possible
usage.
test <- function() {
on.exit(print(1))
ex <- sys.on.exit()
str(ex)
cat("exiting...\n")
}
> test()
NULL
exiting...
[1] 1
Looking at the code suggests that on.exit is installing the code in
a different context from the one
2006 Aug 31
2
stop R mainloop without calling exit(1)
Hello,
I'm trying to make my Java application work with R, which involves
sending and retrieving data and to run R functions from within the
Java application. I also need to have "live interaction" with R, to
show the R console output (e.g. warnings and print) and to enable the
user to enter input when a function asks for it.
Therefore I created a simple R console in Java using JRI