Displaying 20 results from an estimated 1200 matches similar to: "Calling function with proto in Rinternals.h"
2002 Nov 07
0
Finalizer function?
I have some code that calls R's finalizer interface, e.g.,
.Call('R_RegisterFinalizerEx', object, function, TRUE)
This worked pre 1.6, but now I get '.Call function name not in call
table'. Are functions listed in Rinternals.h no longer available in
.Call? Or is this a namespace issue? How do I reference the function?
Thanks.
Tim
--
Timothy H. Keitt
The University of
2004 May 03
1
Finalization and external pointers
I'm adding things to the Windows RGui so that there's more control of
the interface from within R.
One thing I'm considering is giving access to the Graphapp window
objects using external pointers. This raises the issue of
finalization on both sides:
- If someone creates a pointer referring to a window, then that
pointer should be changed to NULL when the window is closed.
- If
2013 May 24
1
Problem with Rboolean in c++ code
I am trying to use R_RegisterCFinalizerEx to ensure some c++ object is
properly deleted after use. However, I run into some problems when
trying to pass in the third argument which is an Rboolean. The line
'R_RegisterCFinalizerEx(p, finalizer, TRUE);' generates the following
error when trying to compile using R CMD SHLIB:
g++ -I/usr/share/R/include -DNDEBUG -fpic -O2 -pipe
2020 Apr 03
4
The finalizer of the externalPtr does not work when closing R?
Hi all,
I found that the finalizer of the externalPtr is not called when R is
quitting. However, manually calling GC() works fine. This behavior is
observed on devel R 2020-04-02 r78142 on Win and R 3.6.3 on Ubuntu. I make
a reproducible package here: https://github.com/Jiefei-Wang/example
Here is the detail of how to reproduce the problem, I create a temporary
file in the package root path and
2001 Jul 10
1
Object finalization
I see some code in R to attach finalizers to external pointer references
(Register[C]Finalizer). Anyone have an example of how to code the
finalizer? R_RegisterCFinalizer accepts a C function, but I can't see
how to get it to operate on the pointer, since the pointer is not passed
to the function when its called. RegisterFinalizer takes an R closure,
but how is it called from R (tried
2007 Feb 25
3
R/C++/memory leaks
Dear all,
I have wrapped a C++ function in an R package. I allocate/deallocate
memory using C++ 'new' and 'delete'. In order to allow user
interrupts without memory leaks I've moved all the delete statements
required after an interrupt to a separate C++ function freeMemory(),
which is called using on.exit() just before the .C() call.
I am concerned about the
2007 Mar 19
3
Rinternals.h and undefined symbols
Hi,
I'm trying to register my native routines using R_registerRoutines
(...). I can compile the code, but the loader cannot resolve the symbol:
undefined symbol:
_Z18R_registerRoutinesP8_DllInfoPK12R_CMethodDefPK15R_CallMethodDefS3_S6
_
$ nm bgx.Rcheck/bgx/libs/bgx.so | grep R_registerRoutines
U
_Z18R_registerRoutinesP8_DllInfoPK12R_CMethodDefPK15R_CallMethodDefS3_S6
2005 Jul 26
1
Error registering finalizer
What exactly is a reference object? I'm getting this error
message attempting to register a finalizer:
can only weakly reference/finalize reference objects
I don't see any problem with the code... Here's what appears
to be the relevant portions.
setClass("PDNNObject",
representation(handle = "externalptr",
id =
2006 Feb 08
1
Rf_protect in Rinternals.h
Hello!
I'd like to ask you a question about c (macros):
In Rinternals.h are defined:
a) SEXP Rf_protect(SEXP);
b) #define protect Rf_protect
c) #define PROTECT(s) protect(s)
As far as I understand the calls Rf_protect( x ), protect( x ) and
PROTECT( x ) are all equalent.
So whats the reason that there are 2 macros defined? Why 3 times the
same when 1 distinct function would be
2014 Aug 22
1
what are labels in struct sxpinfo_struct from Rinternals.h mean?
Dear Rdevelers,
? ? ?The following struct is in the Rinternals.h. I want to know ?the meanings of labels or names like "gp,mark,obj,named,trace....." . TKS!
struct sxpinfo_struct {
? ? SEXPTYPE type ? ? ?: ?5;/* ==> (FUNSXP == 99) %% 2^5 == 3 == CLOSXP
? ? * -> warning: `type' is narrower than values
? ? * ? ? ? ? ? ? ?of its type
? ? * when SEXPTYPE was an enum
2004 Feb 11
1
About the macro defined in Rinternals.h
Hello everyone,
I try to write a c++ code which calls embedded R and uses some of R
internal functions. What I read is just lots of macro names defined in
the Rinternals.h or Rdefines like R_Parse, Rf_install and so on. But
where can I get the detailed information about the parameters of these
macro? For example, what about the parameters of SEXP
R_ParseVector(SEXP, int, ParseStatus *)?
2013 Nov 03
1
on.exit() & sys.on.exit(): Calling them via eval() does not work as hoped
Why does the following eval() call on sys.on.exit() not return what I
expect/evaluate in the proper environment?
foo <- function() {
cat("foo()...\n");
on.exit( message("exiting") )
cat("sys.on.exit():\n")
res <- sys.on.exit()
print(res)
cat("eval(sys.on.exit()):\n")
expr <- quote(sys.on.exit())
print(expr)
res <- eval(expr)
2007 Apr 06
2
wishlist: additional argument in R_tryEval (Rinternals.h)
Hi,
R_tryEval, exported in Rinternals.h but not part of the API, is
currently defined as:
R_tryEval(SEXP e, SEXP env, int *ErrorOccurred);
I'm trying to embed R in an application (basically yet another GUI),
and this has been very helpful to catch errors. It would be even more
helpful if it also gave access to the visibility flag. I can wrap this
in a call to withVisible, and that works
2005 Jan 30
2
Rinternals.h and iostream don't play nice together'
Hi,
Consider the following file.
*******************************
foo.cc
*******************************
#include <R.h>
#include <Rinternals.h>
#include <iostream>
*******************************
R CMD SHLIB foo.cc
gives scads of errors. I've use C++ extensively with R before (using C
linkage) but not with Rinternals.h. I'm puzzled. The errors make no sense
to me. Am
2007 Oct 16
2
Bootstrapping Contrasts for Repeated Measures ANOVA
I have executed a Repeated Measures ANOVA with one DV (latency) and
one within subject factor (acoustic condtion: 3 levels) by
bootstrapping my sampling distribution of F from the empirical sample
distribution. I chose to resample because the sample distribution
deviates from normality a lot.
The overall F is significant and now I wish to decompose this with
contrasts to ask if latencies to
2004 Jun 10
1
tryCatch() and preventing interrupts in 'finally'
With tryCatch() it is possible to catch interrupts with tryCatch(). Then you
can use a 'finally' statement to clean up, release resources etc. However,
how can I "protect" against additional interrupts? This is a concern when
the hold down Ctrl+C and generates a sequence of interrupts. Example:
tryCatch({
cat("Press Ctrl+C...\n");
Sys.sleep(5);
}, interrupt =
2025 Feb 02
1
Suggestion to emphasize Rboolean is unrelated to LGLSXP in R-exts
The good news is that without a C23-enabled compiler, the problem will
only happen to source files that #include <stdbool.h>. The bad news is
that such a source file will technically disagree with the rest of R
about the type of Rboolean, including the prototypes of the API
functions that accept Rboolean:
#include <stdbool.h>
#include <Rinternals.h>
typedef void
2004 Jun 04
2
building wxruby-swig 0.0.16 on Mac
Grabbed 0.0.16 and tried a build for kicks.
...all good, except for a warning in MenuBar.cpp, then...
g++ -c -I/usr/local/lib/wx/include/mac-2.4 -D__WXMAC__ -DWXMAKINGDLL
-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -fno-common -fno-common -pipe
-fno-common -x objective-c++ -I
/usr/local/lib/ruby/gems/1.8/rake-0.3.2/lib -I
/usr/local/lib/ruby/site_ruby/1.8 -I
2020 Feb 05
2
[fdo] Detect my own session being closed
Hello:
I created a backup program that uses an external HD to do the backups, and
it is designed to allow several users to share the same hard disk by
storing each backup in a different folder. To ensure that the backups are
always made, it automatically mounts the backup hard disk when it detects
it (using udisk2 DBus interface). The first problem is that if the backup
program of the user A
2008 Apr 04
1
lme4: How to specify nested factors, meaning of : and %in%
Hello list,
I'm trying to figure out how exactly the specification of nested random
effects works in the lmer function of lme4. To give a concrete example,
consider the rat-liver dataset from the R book (rats.txt from:
http://www.bio.ic.ac.uk/research/mjcraw/therbook/data/ ).
Crawley suggests to analyze this data in the following way:
library(lme4)
attach(rats)
Treatment <-