| 416 | } |
| 417 | |
| 418 | Rcpp::List allocateDataFrame(const vector<string>& rownames, const vector<string>& colnames, vector<RblpapiT>& coltypes) { |
| 419 | |
| 420 | if(colnames.size() != coltypes.size()) { |
| 421 | throw std::logic_error("colnames size inconsistent with column types size."); |
| 422 | } |
| 423 | |
| 424 | Rcpp::List ans(colnames.size()); |
| 425 | ans.attr("class") = "data.frame"; |
| 426 | ans.attr("names") = colnames; |
| 427 | ans.attr("row.names") = rownames; |
| 428 | for(size_t i = 0; i < colnames.size(); ++i) { |
| 429 | ans[i] = allocateDataFrameColumn(coltypes[i], rownames.size()); |
| 430 | } |
| 431 | return ans; |
| 432 | } |
| 433 | |
| 434 | Rcpp::List allocateDataFrame(size_t nrows, const vector<string>& colnames, const vector<RblpapiT>& coltypes) { |
| 435 |
no test coverage detected