Displaying 20 results from an estimated 200 matches similar to: "Question about copying arguments in C."
2004 Apr 26
1
Segfault: .Call and classes with logical slots
Hi,
the following example aiming at a class containing a logical slot
segfaults under R-1.9.0 when `gctorture(on = TRUE)' is used:
Code code (dummy.c):
#include <Rdefines.h>
SEXP foo() {
SEXP ans;
PROTECT(ans = NEW_OBJECT(MAKE_CLASS("test")));
SET_SLOT(ans, install("lgl"), allocVector(LGLSXP, 1));
LOGICAL(GET_SLOT(ans,
2003 Jun 23
3
FW: S4 classes, creating in C
I am using C code to create an S4 object based on Douglas Bates's example
in his lecture notes on
<http://www.ci.tuwien.ac.at/Conferences/DSC-2003/Tutorials/RExtensions/slide
s.pdf>
http://www.ci.tuwien.ac.at/Conferences/DSC-2003/Tutorials/RExtensions/slides
.pdf
e.g.
SEXP La_DGE_dc(SEXP A)
{
SEXP aa = PROTECT(duplicate(A));
SEXP adims, pivot, val;
int
2003 Sep 05
1
Problem with S4 slots in C code (PR#4073)
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_000_01C3738F.63DE3390
Content-Type: text/plain;
charset="iso-8859-1"
#I want to be able to create a new S4 class and read data into it using C
code
# Here is a very simple S4 object inheriting from "array", but with 5
2004 Oct 08
2
R-2.0.0 findVar and findFun question
Dear all,
when working on a project with embedded R, I found out that R-2.0.0 causes
a problem where older versions worked OK.
Rf_findVar(...) causes the following error when used to find a generic function
(such as print):
fun = Rf_findVar(...);
R_tryEval(fun, ...);
Error in function (object, ...) : Invalid generic function in usemethod
Alternatively, using Rf_findFun(...) seems OK in this
2002 Jan 09
0
methods: Extending classes
Hi (again), let's say I want to create a class Matrix that extends the class
matrix, but I can't get it to work. I define the class as
> setClass("Matrix", "matrix")
> getClass("Matrix")
No Slots, prototype of class "matrix"
Extends:
Class "matrix" directly.
Class "structure" by class "matrix".
2004 Mar 06
2
.Call: is new attribute of protected object auto-protected
Hi,
I have an SEXP obj in a C function called via .Call(). The obj is
protected (in fact it is an argument to .Call and therefore
automatically protected). If I set an attribute of obj does the
attribute become protected too? Here is an example
SEXP foo(SEXP obj) {
SET_NAMES(obj, NEW_CHARACTER(3)); /* are names protected or not? */
...
}
Thanks,
Vadim
[[alternative HTML version
2008 Mar 15
1
Experimental R_has_slot() utility
Dear list,
The utility "R_has_slot" mentioned in the file NEWS
("Experimental R_has_slot() utility supplementing R_do_slot()")
appears to be missing from a fresh checkout of the development branch.
$ svn up
At revision 44759.
$ grep -i has_slot `find include -name '*.h'`
$ grep -i _slot `find include -name '*.h'`
include/Rdefines.h:#define GET_SLOT(x, what)
2010 May 06
1
R on kdeedu-svn library problem
Hello,
I am new to this list. ?I am trying to compile the current svn version of
kdeedu on an amd64 linux machine ?which uses R and I get the following
compiler output.
-------------------------------------------
?79%] Building CXX object
cantor/src/backends/R/rserver/CMakeFiles/cantor_rserver.dir/rserver.o
$SOURCES/kdeedu/cantor/src/backends/R/rserver/rserver.cpp: In member
function
2012 Apr 16
1
eval a SYMSXP from C
Can someone offer some advice on how to properly evaluate a SYMSXP
from a .Call ?
I have the following in R:
variable xn, with an attribute "mu" which references the variable mu
in the global environment.
I know "references" is a loose term; mu was defined in this fashion as
a way to implement deferred binding:
foo <- function(x,mu) {
attr(x,"mu") <-
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 *)?
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 =
2009 Nov 13
0
Problem building R 2.10 release
Hi,
I am having problem building R 2.10, and it does not seem anyone else is
having a similar problem...
My system information:
uname -m = x86_64
uname -r = 2.6.31-ARCH
uname -s = Linux
gcc (GCC) 4.4.1
icc (ICC) 11.0 20081105
The first problem I encounter seems to be with icc and wctype.h during
./configure.
export CC="icc -std=c99"
export CXX=icpc
export OBJC="icc
2006 Nov 27
1
R.DLL mapping by P/Invoke
After a long processing, I was able to create a version of a small C# class
that was able to emulate the rproxy by P/Invoke. This is mostly to find a
workaround a performance problem of the StatConnector.
It's almost work but ... I have strange memory exception when I call the
print function. The variable seems to not survive from one call to the
other.
As there is no debug symbol for
2020 Mar 24
0
help with rchk warnings on Rf_eval(Rf_lang2(...))
On 24 March 2020 at 11:39, Lionel Henry wrote:
| > Shield<SEXP> res(Rcpp_fast_eval(Rf_lang2(asEnvironmentSym, x), R_GlobalEnv));
|
| The call should be protected before evaluation though. So more like:
|
| Shield<SEXP> call(Rf_lang2(asEnvironmentSym, x));
| return Rcpp_fast_eval(call, R_GlobalEnv);
Good catch.
And recursive grep for Rf_lang2 in the Rcpp sources tree suggests
2020 Mar 24
2
help with rchk warnings on Rf_eval(Rf_lang2(...))
> Shield<SEXP> res(Rcpp_fast_eval(Rf_lang2(asEnvironmentSym, x), R_GlobalEnv));
The call should be protected before evaluation though. So more like:
Shield<SEXP> call(Rf_lang2(asEnvironmentSym, x));
return Rcpp_fast_eval(call, R_GlobalEnv);
Best,
Lionel
On 3/23/20, Dirk Eddelbuettel <edd at debian.org> wrote:
>
>
> On 23 March 2020 at 17:07, Ben Bolker wrote:
>
2004 Aug 18
3
R as shared library
Hello folks,
I'm embarking on a project to embed R into the Apache web server, and
I'd like your help. Currently, I'm looking for a way for R code to call
back into a shared library from which the R shared library was loaded.
Essentially, apache starts and loads mod_R.so which runs an
initialization routine which calls Rf_initEmbeddedR() and the following
code:
/* override to
2023 Nov 11
1
New syntax for positional-only function parameters?
6 ?????? 2023 ?. 22:54:24 GMT+03:00, mikkmart via R-devel <r-devel at r-project.org> ?????:
>The pattern of functions accepting other functions as inputs and
>passing additional ... arguments to them is prevalent throughout
>the R ecosystem. Currently, however, all such functions must one
>way or another tackle the problem of inadvertently passing arguments
>meant to go to
2007 Sep 20
1
copying promise
1. Is there some way to copy a promise so that the copy has the same
expression in its promise as the original. In the following we
y is a promise that we want to copy to z. We
want z to be a promise based on the expression x since y is a
promise based on the expression x. Thus the answer to the code
below is desired to be z=2 but its 1, 1 and y in the next three
examples so they are not the
2009 Sep 03
1
Running an expression 1MN times using embedded R
Hello,
I'm evaluating this expression
expression({ for(x in 1:5){ .Call('rh_status','x') }})
a million times from a program with R embedded in it. I have attached
reproducible code that crashes with
Program received signal SIGSEGV, Segmentation fault.
0x00002b499ca40a6e in R_gc_internal (size_needed=0) at memory.c:1309
1309 FORWARD_NODE(R_PPStack[i]);
Current language:
2007 Oct 17
0
Using R.dll in .NET IPC
Hi - I wrapped R.dll up using somebody code online (see below). I am comparing R on .NET IPC with R(D)COM.
I got it all working. Except, I realize that in my client code of the IPC remoting, if I call 'plot' function in R via EvaluateNoReturn, I don't seem to see any results on the R plot window (although the window pops up). Is there anything to do with the code of R.dll wrapper