Am porting some C code with a long data structure (40+ items) and was following Ralf Stubner's advice from a previous question: In Rcpp, how to get a user-defined structure from C into R. Things worked great until I tried to add the 21st element:
return Rcpp::wrap(Rcpp::DataFrame::create(Rcpp::Named("institution") = x.institution, // 1st entry
...
Rcpp::Named("number_of_samples") = number_of_samples, // 19th entry
Rcpp::Named("channel_name") = x.channel_name )); // 20th entry
This compiles and runs. When I add any more entries, I get an error: "no matching function for call to 'create'.
Rcpp::Named("number_of_samples") = number_of_samples, // 19th entry
Rcpp::Named("channel_name") = x.channel_name, // 20th entry
Rcpp::Named("channel_name2") = x.channel_name )); // 21st entry
I don't really want "channel_name" listed twice; I just wanted to convince myself that it wasn't a problem with the actual values being entered. Is there some kind of limit in Rcpp code to how big a data frame can be? If not, how would you go about looking for what is causing this error?
In regards to the Comment I gave in the previous question, it is difficult for someone like to me to debug such a problem, because I don't really understand the internal workings of Rcpp. I'm calling "wrap" and "create" functions without really knowing how they do what they do, so it is difficult to know how to fix things when something goes wrong. Rcpp is great; it just seems that you have to program in it by imitation of existing code.