similar to: Rf_protect in Rinternals.h

Displaying 20 results from an estimated 7000 matches similar to: "Rf_protect in Rinternals.h"

2010 Aug 23
1
Speed improvement to PROTECT, UNPROTECT, etc.
As I mentioned in my previous message about speeding up evalList, I've been looking at ways to speed up the R interpreter. One sees in the code many, many calls of PROTECT, UNPROTECT, and related functions, so that seems like an obvious target for optimization. Indeed, I've found that one can speed up the interpreter by about 10% by just changing these. The functions are actually macros
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
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 *)?
2004 Feb 17
2
interfacing C++ using .Call
Hi folks, I apologise if this is in the documentation somewhere, but I can't seem to find it. I also did a search of CRAN without any success. I'm using R-1.8.1 (pre-compiled) on Windows 2000 with Rtools and mingw 2.0.0 (which includes gcc/g++ 3.2). I'm trying to link some C++ code from another application to R using the .Call interface and am experiencing some problems. I was
2002 Nov 09
1
Calling function with proto in Rinternals.h
(Tried this query on r-help with no luck, maybe someone here can help?) I would like to call the 'RFinalizerEx' function that appears in Rinternals.h using ".Call". It worked for me in the past, but now I get an error message something like: 'call function name not in call table'. I'm using the 1.6.1 rpm from CRAN. Anyone know what's going on? Thanks. Tim --
2004 Jun 16
1
Compiling C++ package source: linking problem?
Dear All I'm currently developing a package for R (1.9.0) on Win32, with C++ source code. Having followed the instructions in readme.packages, my code compiles fine with R CMD SHLIB (as well as R CMD check) ... until I start using the internal R functions. (Interesting: Rprintf seems to be the exception.) For instance, the following code compiles fine: #include <R.h> #include
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)
2005 Oct 31
1
R-functions in C-Code
Dear R users, I would like to use several R functions from a C-code and I have read the "Introduction to the .C Interface to R". Unfortunately, my shared library with the C-code works only in cases where I use R-routines that are defined Rmath.h, eg. ************************************* less test.c: #include <R.h> #include <Rinternals.h> #include <Rmath.h> void
2010 Jan 02
3
R-devel Digest, Vol 83, Issue 2
[Disclaimer: what is below reflects my understanding from reading the R source, others will correct where deemed necessary] On 1/2/10 12:00 PM, r-devel-request at r-project.org wrote: > > Hello, > > We are currently making lots of changes to Rcpp (see the open Rcpp > mailing list if interested [1] in the details). > > We are now using [2] R_PreserveObject and R_ReleaseObject
2006 Feb 16
3
Rf_errorcall - translate to Pascal
Hello! I (try to) convert the external R header files to Pascal (Delphi). At one place I stumbled over a macro that uses a method that is not declared in a LGPL header file: In Rinternals.h: #define error_return(msg) { Rf_error(msg); return R_NilValue; } #define errorcall_return(cl,msg){ Rf_errorcall(cl, msg); return R_NilValue; } ~~~~~~~~
2005 Oct 03
1
storage.mode, C data types and speed
Hi, I am trying to speed up part of an algorithm in which certain columns of a large matrix (X) are replaced by the element-wise product of a matrix (M) and a vector (v). In R, the code might be X[, ind] <- M * v I have written a small C routine to do this for me, but the timing depends on how I define the storage.mode of the objects in R and the data types in C, in a way which I don't
2007 Aug 23
1
.Call and to reclaim the memory by allocVector
Hi, I am not sure if this is a bug and I apologize if it is something I didn't read carefully in the R extension manual. My initial search on the R help and R devel list archive didn't find useful information. I am using .Call (as written in the R extension manual) for the C code and have found that the .Call didn't release the memory claimed by allocVector. Even after applying
2007 Aug 23
1
.Call and to reclaim the memory by allocVector
Hi, I am not sure if this is a bug and I apologize if it is something I didn't read carefully in the R extension manual. My initial search on the R help and R devel list archive didn't find useful information. I am using .Call (as written in the R extension manual) for the C code and have found that the .Call didn't release the memory claimed by allocVector. Even after applying
2001 Sep 10
1
problems linking c++ code
I've been trying to learn about dynamically loading subroutines in R. Ultimately I would like to use this approach to implement some simulations. For the moment though, I've run into a problem compiling c++ code and loading it into R. The 'C/C++' and 'R'code below works fine when compiled and linked with gcc, but gives an error when the library is compiled and linked with
2013 Apr 11
1
La_svd compiler error
Dear All, I have been trying to compile a package for windows that we have written. Since R version 3.0.0 the package doesn't compile any more. (On Linux the package compiles without errors). The error specifically says: gcc -m32 -I"C:/PROGRA~1/R/R-30~1.0/include" -DNDEBUG -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O3 -Wall -std=gnu99 -mtune=core2 -c
2012 Jun 21
2
debug R objects at C level
Dear R-devel, I am now at a debugging phase, and would like to inspect the (individual) values in an arbitrary R vector. It should be simple, but after hours of reading I am simply unable to find the right information. A possible C code is: ????????????????? # include <R.h> # include <Rinternals.h> # include <R_ext/Rdynload.h> SEXP foo(SEXP x) // where x is a vector passed by
2005 Jan 24
4
converting R objects to C types in .Call
Dear People, I'm trying to write an R wrapper for a C++ library, using .Call. I've never used .Call before. I'm currently having some difficulties converting a R character string to a C one. Here is a little test program. #include <R.h> #include <Rinternals.h> #include <stdio.h> SEXP testfn(SEXP chstr) { char * charptr = CHAR(chstr); printf("%s",
2019 Mar 01
1
Surprising results from INTEGER_GET_REGION with ALTREP object
Dear Listmembers, wanting to learn more about ALTREP I wrote the following function to extract a subsequence from an integer vector: #include <Rinternals.h> SEXP integer_get_region(SEXP _x, SEXP _i, SEXP _n) { int i = INTEGER(_i)[0]; int n = INTEGER(_n)[0]; SEXP result = PROTECT(Rf_allocVector(INTSXP, n)); INTEGER_GET_REGION(_x, i, n, INTEGER(result)); UNPROTECT(1); return
2012 Dec 15
3
interfacing with .Call
Hi My code is as following: #include <R.h> #include <Rinternals.h> //* the Projector part *// void Projector(double *L, int *dimL, double *G, int *dimG, double *W, int *dimW, int *xymod, int *dimxy, double *modif, int *dimif, double *Lsum) { ...} //* the interface part *// #define getDim(A) INTEGER(coerceVector(getAttrib(A,R_DimSymbol), INTSXP)) SEXP Projector5(SEXP L, SEXP G,
2012 Nov 09
3
Crash - cause 'memory not mapped'
i'm using the following c++ code using namespace std; #include <iostream> #include <stdio.h> #include <opencv/cv.h> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv/highgui.h> #include <opencv/cv.h> #include <R.h> #include <Rinternals.h> #include <Rmath.h> extern "C" { SEXP