constructing a Data Frame in Rcpp

前端 未结 4 1750
名媛妹妹
名媛妹妹 2020-12-14 23:20

I want to construct a data frame in an Rcpp function, but when I get it, it doesn\'t really look like a data frame. I\'ve tried pushing vectors etc. but it leads to the same

4条回答
  •  余生分开走
    2020-12-15 00:08

    It seems Rcpp can return a proper data.frame, provided you supply the names explicitely. I'm not sure how to adapt this to your example with arbitrary names

    mkdf <- '
        Rcpp::DataFrame dfin(input);
        Rcpp::DataFrame dfout;
        for (int i=0;i

提交回复
热议问题