Hi!<br><br>I'm new to the group, to rcpp and to C++ also :-P<br><br>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.<br><br>
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.<br><br>This is a snippet of the procedure:<br>
<br>
R["nav_in"] = Rcpp::wrap(input.nav);<br> R["cashFlows_in"] = Rcpp::wrap(input.cashFlows);<br> R["dates_in"] = Rcpp::wrap(input.dates);<br> R["indexesBmk_in"] = Rcpp::wrap(input.indexesBmk);<br>
R["weightsBmk_in"] = Rcpp::wrap(input.weightsBmk);<br> R["benchmark_in"] = Rcpp::wrap(input.benchmark);<br> R["datesBmk_in"] = Rcpp::wrap(input.datesBmk);<br> R["creationDate_in"] = Rcpp::wrap(input.creationDate);<br>
R["activationDate_in"] = Rcpp::wrap(input.activationDate);<br> R["finalDate_in"] = Rcpp::wrap(input.finalDate);<br> R["start_in"] = Rcpp::wrap(input.start);<br> R["type_in"] = Rcpp::wrap(input.type);<br>
<br> SEXP res;<br><br> 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";<br>
res = R.parseEval(evalstr);<br><br>What I obtain is the following:<br><br>Errore in .Call("R_isMethodsDispatchOn", onOff, PACKAGE = "base");<br> Numero di argomenti errato (2), ce ne vogliono 1 per R_isMethodsDispatchOn<br>
terminate called after throwing an instance of 'Rcpp::binding_not_found'<br>what(): binding not found: '.AutoloadEnv'<br>Aborted<br><br>Excuse for the message, which is an Italian/English mix... <br>What is this error about ? And then... the result of the "portfolioBenchmark" function should be a list..How can I convert the returned SEXP res into a list ?<br>
<br>Thanks in advance,<br>Alessandro Torrisi.<br><br>