Displaying 20 results from an estimated 800 matches similar to: "external pointers"
2010 Nov 15
1
SEXP and slots
Hello,
Since people have whisperred about Rcpp, I'd like to play too.
> On 11/15/2010 07:45 AM, Patrick Leyshock wrote:
>> Very helpful, thank you.
>>
>> A couple other questions, please:
>>
>> 1. I've got a function written in C, named "my_c_function". In my R
>> code I call this function, passing to it an INTSXP and a STRSXP,
>>
2000 Aug 31
2
Problem with R INSTALL locfit on DEC alphaev56-dec-osf4.0d
Dear all,
usually I work under linux, but I tried to install R-1.1.1 on
our alpha's which worked well.
However, installation of the locfit package produced the following
warning:
---------%<----------------
Installing package `locfit' ...
libs
/vol/bin/gcc -I/vol/math/R/include -I/usr/local/include -mieee -g
-O2 -c S_e
nter.c -o S_enter.o
S_enter.c: In function `basis':
2009 Jun 06
1
Qs on calling R from C
Consider the following simple C program:
/*** hello_r.c ***/
#include <Rinternals.h>
SEXP hello() {
return mkString("Hello, world!\n");
}
int main(void) {
SEXP x = hello();
return x == NULL; /* i.e. 0 on success */
}
This program segfaults:
% myR/bin/R CMD LINK gcc -I./R-2.9.0/src/include -L./myR/lib64/R/lib -lR
hello_r.c -o hello_r > /dev/null
% hello_r
zsh:
2000 May 22
1
character arguments with call_R (PR#552)
character arguments with call_R do not work except in the first
position. (In other positions, they just yield a single blank
character.)
The error is at line 1858 of dotcode.c which should be changed from
STRING(CAR(pcall))[i]=s;
to
STRING(CAR(pcall))[0]=s;
Jim
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read
2010 Oct 27
2
must .Call C functions return SEXP?
For using R's .Call interface to C functions, all the examples I've
seen have the C function return type SEXP. Why? What does R actually
do with this return type? What happens if I *don't* return a SEXP?
Reason I ask, is I've written some R code which allocates two long
lists, and then calls a C function with .Call. My C code writes to
those two pre-allocated lists, thus, I
2007 Feb 21
2
R unstable and crashes after executing .C
Dear R listers,
I have developed a C function to be executed from R through the ".C" interface. After doing dyn.load, the function executes properly and I get the results. However, after executing my function, R seems to get unstable and crashes (giving a segmentation fault and exiting) whenever I try to do ANYTHING with a relatively large object (creating a new one or even just
2003 Jul 16
1
Integrating R in OpenOffice
Hi All,
A group of about 3-4 of us are looking into the possibility of incorporating R
into OpenOffice's (OO) spreadsheet component (sc) . We wish to use OO's nice
ODBC ability to query a postgresql-based gene expression database thus
populating an OO sc and then use Bioconductor via R to analyse user-selected
parts of this spreadsheet.
We've looked at and compiled and used
2007 Feb 21
1
R unstable and crashes after executing .C
Dear R listers,
I have developed a C function to be executed from R through the ".C" interface. After doing dyn.load, the function executes properly and I get the results. However, after executing my function, R seems to get unstable and crashes (giving a segmentation fault and exiting) whenever I try to do ANYTHING with a relatively large object (creating a new one or even just writing
2011 Jun 26
2
Why is looping in R inefficient, but in C not?
Hey,
I just read another post about calling R from C. Someone on
stackoverflow (DWin makes me suspect its David W.?) referenced this:
http://www.math.univ-montp2.fr/~pudlo/R_files/call_R.pdf
Which made me think: Why is a loop in R bad, but in C not?
And where exactly does looping cost the most? I wrote a piece of code
for my bachelor's thesis where I loop from 1 to 500, and estimate a
2010 Nov 18
1
Performance monitoring tools
Hello,
Are there any good tools available for monitoring the performance of R? I'm
wanting to capture things such as time elapsed in evaluating an expression,
memory usage over time (or operation), and so on.
I could build my own but would like to follow established practice, if there
is one.
Thank you,
Patrick
[[alternative HTML version deleted]]
2011 Feb 04
1
matching symbols to objects
Hello,
I'm trying to access an object, given only its name as a symbol. I cannot
figure out how to proceed. Suppose I call substitute( ) on the expression
'x + 2':
> parse.tree <- substitute(x + 2);
The constituents of parse.tree are of type symbol and numeric:
> str(parse.tree[[1]])
symbol +
> str(parse.tree[[2]])
symbol x
> str(parse.tree[[3]])
num 2
Suppose
2008 May 14
0
Parallel computing with rgenoud and snow: external file I/O possible?
I am trying to use rgenoud and snow with an external model and file I/O.
Unlike the typical application of rgenoud and snow, I need to run an
external executable and do pre- and post-processing of input and output
files for each parameter set generated by genoud(). I'm hoping that
someone can suggest improvements to my approach and a work-around for
file I/O problems I've encountered when
2004 Sep 20
1
problem typcasting return of R_ExternalPtrAddr(SEXP s)
In the odesolve routine lsoda(), I allow the function (named func) that calculates the system of differential equations to be defined in a dll that has been dynamically loaded from the file named in dllname. I use getNativeSymbolInfo(func, dllname)$address to get the address of the function and pass it to a C function called via the .Call interface. Inside that C function, I use
2007 Aug 03
2
How to properly finalize external pointers?
Dear R .Call() insiders,
Can someone enlighten me how to properly finalize external pointers in C code (R-2.5.1 win)? What is the relation between R_ClearExternalPtr and the finalizer set in R_RegisterCFinalizer?
I succeeded registering a finalizer that works when an R object containing an external pointer is garbage collected. However, I have some difficulties figuring out how to do that in an
1999 Jul 29
0
call_R
I would like to use the call_R mechanism. Unfortunately I don't fully
understand what the arguments are from the example in
"R-0.64.2/demos/dynload".
Could anybody explain me how I have to define the arguments, e.g., I
want to call R with 5 doubles (or double[5]) and func does not return a
value (is that possible or is it necessary to return at least a dummy?).
This is from the
2016 May 14
2
R external pointer and GPU memory leak problem
My question is based on a project I have partially done, but there is still something I'm not clear.
My goal is to create a R package contains GPU functions (some are from Nividia cuda library, some are my self-defined CUDA functions)
My design is quite different from current R's GPU package, I want to create a R object (external pointer) point to GPU address, and run my GPU function
2011 Sep 14
2
External pointers and an apparent memory leak
I'm using external pointers and seemingly leaking memory. My determination of a memory leak is that the R process continually creeps up in memory as seen by top while the usage as reported by gc() stays flat. I have isolated the C code:
void h5R_allocate_finalizer(SEXP eptr) {
Rprintf("Calling the finalizer\n");
void* vector = R_ExternalPtrAddr(eptr);
free(vector);
2013 Dec 16
1
External pointers and changing SEXPTYPE
Dear Developers,
I've been struggling through writing R extension in C. I've been using
an external pointer to store my data (please see sample below). I
encountered a very weird erroneous behaviour: when I tried to use my
external pointer to a structure holding several types of data,
including SEXPs, I discovered that SEXPs change their types between
returning from initialization
1999 Apr 07
1
library
I also have several packages in my RW0633 in Windoze
and I would like to keep them in one place when I update the R
system.
Brian say to modify Rprofile to
..lib.loc <- c("c:/MyR/library",.Library)
now Rprofile has a line like
.lib.loc <- unique(c(unlist(strsplit(getenv("RLIBS"),":")),.Library)
Sorry to be dense but where should I put the
2016 Sep 02
0
CRAN packages maintained by you
Hi,
I have the same problem and, at a first look, the issues reported by the
CRAN checks seemed easy to fix. However, after checking it again locally
and on http://win-builder.r-project.org it appeared that GCC 4.9.3
(Windows, Rtools 3.4), same also on win-builder reports even more
issues, especially legacy Fortran (mainly Roger's #2 and #3), but also
"warning: ISO C forbids