[Rcpp-devel] Are c++ vector types provided by Rccp real c++ type?

Héloïse Gauvin heloise.gauvin at gmail.com
Tue Jun 7 17:44:49 CEST 2011


I am a new user of Rccp. I've been trying to understand since 2 weeks how
I'll be able to convert a Splus library constructed with multiple C++
functions (and files)  into a nice and free R package.

My question seems basic to me but I'll let you judge I get this error

interface.cpp: In function 'SEXPREC* CreateObjectGen(SEXPREC*, SEXPREC*, S
interface.cpp:115:87: error: cannot convert 'Rcpp::Fast<Rcpp::Vector<14> >'
'int*' for argument '1' to 'int CompGen(int*, int*, int*, int*, int*, int*,
int*, int*, int*)'

Do this mean I have to modify every function I am calling from inside
another c++ function? Is it possible?

Here I have this code:

#include"outils.h" // 'outils.cpp' is the place where the function CompGen()

#include "interface.h"

#include <stdlib.h>

using namespace Rcpp ;

RcppExport SEXP CreerObjetGen(SEXP SInd,SEXP SPere, SEXP SMere, SEXP SSexe)

    NumericVector xSInd(SInd),  xSPere(SPere),  xSMere(SMere),
    Fast<NumericVector> fSIndividu(xSIndividu), fSPere(xSPere),
fSMere(xSMere) , fSSexe(xSSexe);

//  the 2nd function I called...

I used to have this before I had to change them to types provided by Rccp

 int* plIndividu    =INTEGER_POINTER(AS_INTEGER(SIndividu));
    int* plPere        =INTEGER_POINTER(AS_INTEGER(SPere));

I've also read the last post on the list... is it because I can't send
pointers through a function?

thanks for the help,


Héloïse Gauvin
PhD student, Epidemiology
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20110607/8f194873/attachment.htm>

More information about the Rcpp-devel mailing list