[Rcpp-devel] data frame construction error

Robin Aly r.aly at ewi.utwente.nl
Thu Mar 3 17:22:21 CET 2011


Hi,

I am building a Rcpp wrapper for the Information Retrieval package Lemur.

For this, I need to construct a data frame of a dynamic number of columns.

In my code, I do the following (condensed view):

     SEXP result=R_NilValue;
     std::vector<std::vector<COUNT_T>*> tfs(iters.size());
     tfs[i] is a numeric vector N elementer
     for (int i=iters.size()-1;i>=0;i--) {
         result=grow(_[tstem] = *tfs[i],result);
     }

     result=grow(_["DOCID"] = did,result);

     DataFrame res(::Rf_lcons( ::Rf_install( "data.frame"), result));

Suppose now, both did and tfs[i] have N entries. Now if I select data
such that N is small than 10000 everything works. However if I choose
N bigger, I get the following error message.

terminate called after throwing an instance of 'Rcpp::not_compatible'
   what():  could not convert using R function : as.data.frame
Aborted

I tried a lot of debugging and I don't find any structural differences 
with the
additional data.

Would be great, if someone has an idea.
Robin


More information about the Rcpp-devel mailing list