[Rcpp-devel] Rcpp::binding_not_found error

Alessandro Torrisi alessandro.torrisi at gmail.com
Fri Sep 24 13:31:11 CEST 2010


Thanks :-)

Just for full information this is the content of my object:

        vector<double> nav;
        vector< vector<double> > cashFlows;
        string creationDate;
        string activationDate;
        string finalDate;
        string benchmark;
        vector<string> dates;
        vector<string> datesBmk;
        vector< vector<double> > indexesBmk;
        vector< vector<double> > weightsBmk;
        double start;
        string type;

Are those objects automatically wrapped by Rcpp ?

My environment is Linux Ubuntu 32 bit with R version 2.11.1 (2010-05-31).
Do you need more info ?

Thanks in advance,
Alex

On Fri, Sep 24, 2010 at 1:18 PM, Romain Francois
<romain at r-enthusiasts.com>wrote:

> Le 24/09/10 13:07, Alessandro Torrisi a écrit :
>
>  Hi!
>>
>> I'm new to the group, to rcpp and to C++ also :-P
>>
>
> welcome.
>
>
>  I'm trying to embed R in a little program which loads a txt file, parses
>> it into an object and calls a function developed by our R coders.
>>
>> What I aim to do is to move one of our actual Java procedures (built on
>> Java/Rserve architecture) to C++/RInside/Rcpp, I think we could have lot
>> of improvements in this way.
>>
>> This is a snippet of the procedure:
>>
>>     R["nav_in"] = Rcpp::wrap(input.nav);
>>     R["cashFlows_in"] = Rcpp::wrap(input.cashFlows);
>>     R["dates_in"] = Rcpp::wrap(input.dates);
>>     R["indexesBmk_in"] = Rcpp::wrap(input.indexesBmk);
>>     R["weightsBmk_in"] = Rcpp::wrap(input.weightsBmk);
>>     R["benchmark_in"] = Rcpp::wrap(input.benchmark);
>>     R["datesBmk_in"] = Rcpp::wrap(input.datesBmk);
>>     R["creationDate_in"] = Rcpp::wrap(input.creationDate);
>>     R["activationDate_in"] = Rcpp::wrap(input.activationDate);
>>     R["finalDate_in"] = Rcpp::wrap(input.finalDate);
>>     R["start_in"] = Rcpp::wrap(input.start);
>>     R["type_in"] = Rcpp::wrap(input.type);
>>
>
> I think the Rcpp::wrap is redundant, you could e.g. write :
>
> R["nav_in"] = input.nav ;
>
>
>      SEXP res;
>>
>>     string evalstr = "res <- portfolioBenchmark(nav_in, cashFlows_in,
>> dates_in, indexesBmk_in, weightsBmk_in, benchmark_in, datesBmk_in,
>> creationDate_in, activationDate_in, finalDate_in, start_in, type_in);
>> res";
>>     res = R.parseEval(evalstr);
>>
>> What I obtain is the following:
>>
>> Errore in .Call("R_isMethodsDispatchOn", onOff, PACKAGE = "base");
>>    Numero di argomenti errato (2), ce ne vogliono 1 per
>> R_isMethodsDispatchOn
>> terminate called after throwing an instance of 'Rcpp::binding_not_found'
>> what(): binding not found: '.AutoloadEnv'
>> Aborted
>>
>> Excuse for the message, which is an Italian/English mix...
>> What is this error about ?
>>
>
> Which platform are you using ?
>
> There seem to be an initialization problem, which I think I have only seen
> on windows so far, hence my question.
>
>
> And then... the result of the
>
>> "portfolioBenchmark" function should be a list..How can I convert the
>> returned SEXP res into a list ?
>>
>
> You could do this I suppose:
>
> Rcpp::List mylist( res ) ;
>
>
>  Thanks in advance,
>> Alessandro Torrisi.
>>
>
>
> --
> Romain Francois
> Professional R Enthusiast
> +33(0) 6 28 91 30 30
> http://romainfrancois.blog.free.fr
> |- http://bit.ly/cCmbgg : Rcpp 0.8.6
> |- http://bit.ly/bzoWrs : Rcpp svn revision 2000
> `- http://bit.ly/b8VNE2 : Rcpp at LondonR, oct 5th
>
>
>


-- 
Alessandro Torrisi
Information Technology Consultant
Email: alessandro.torrisi at gmail.com
Skype: alessandro.torrisi
Tel: +39/333/2442546

"Questo documento è formato esclusivamente per il destinatario. Tutte le
informazioni ivi contenute, compresi eventuali allegati, sono soggette a
riservatezza a termini del vigente D.Lgs. 196/2003 in materia di "privacy" e
quindi ne è proibita l'utilizzazione. Se avete ricevuto per errore questo
messaggio, Vi preghiamo cortesemente di contattare immediatamente il
mittente e cancellare la e-mail. Grazie."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20100924/d92e2a40/attachment.htm>


More information about the Rcpp-devel mailing list