Re: [Rcpp-devel] Maximum Columns in Rcpp DataFrame (revisited)

2014-07-08 Thread Kevin Ushey
A simple proof of concept that you might find useful: #include using namespace Rcpp; class ListBuilder { public: ListBuilder() {}; ~ListBuilder() {}; inline ListBuilder& add(std::string name, SEXP x) { names.push_back(name); elements.push_back(x); return *this; } inline

Re: [Rcpp-devel] Maximum Columns in Rcpp DataFrame (revisited)

2014-07-08 Thread Kevin Ushey
Maybe we need a DataFrameBuilder class that someone could use like so: DataFrame df = DataFrameBuilder::create() .add("column 1", col1) .add("column 2", col2) .add("column 3", col3); This could be made as a generic VectorBuilder class as well. Or maybe I've been writi

Re: [Rcpp-devel] Maximum Columns in Rcpp DataFrame (revisited)

2014-07-08 Thread Steffen Neumann
Hi, thanks for the quick answer. I didn't find how to *easily* populate my list with named elements without fiddling with the names attribute, so I ended up creating two dataframes and then cbinding them from within C++ Rcpp::Language("cbind", allScanHeaderInfo, allScanHeaderInfo2).eval() ; Y

Re: [Rcpp-devel] Maximum Columns in Rcpp DataFrame (revisited)

2014-07-08 Thread Dirk Eddelbuettel
On 8 July 2014 at 17:51, Steffen Neumann wrote: | Hi, | | I (think I) need to create a DataFrame with more than 20 entries, | because I want another slot in this file: | https://github.com/sneumann/mzR/blob/master/src/RcppRamp.cpp#L221 | | I stumbled upon a 2year old answer here: | | http://lis

Re: [Rcpp-devel] Maximum Columns in Rcpp DataFrame

2013-03-05 Thread Dirk Eddelbuettel
On 5 March 2013 at 19:09, Bierbryer, Andrew wrote: | Hi ? | | | | I am trying to create an rcpp data frame with more than 20 columns. I get a | compile error that it cannot find the matching function for call to | Rcpp::DataFrame::create. | | When I try to create it for 20 columns, it works f