MCPcopy Create free account
hub / github.com/Rblp/Rblpapi / allocateDataFrame

Function allocateDataFrame

src/blpapi_utils.cpp:418–432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

416}
417
418Rcpp::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
434Rcpp::List allocateDataFrame(size_t nrows, const vector<string>& colnames, const vector<RblpapiT>& coltypes) {
435

Callers 3

fieldInfo_ImplFunction · 0.85
bdp_ImplFunction · 0.85

Calls 1

allocateDataFrameColumnFunction · 0.70

Tested by

no test coverage detected