Hi Dirk, Thank you for your prompt reply and suggestion. I tried a lot of times, sometimes I got segfaults and sometimes I got an error messeger "Error: error calling the data.frame function", sometimes I got the DataFrame returned, but the elements is not correct.
2013/3/27 Dirk Eddelbuettel <[email protected]> > > Hi, > > On 27 March 2013 at 21:19, 该走了 wrote: > | Dear Rcpp developer, > | I am tried return a big DataFrame from Rcpp to R, but met some problem! > > If you check the list archives you will see that has been discussed before. > | When n is big, like 4e5, then it will exhaust the memory or crash; when > n is > | small, like 4e3, it can return the correct DataFrame. I was wondering if > > I agree. > > But it probably "just" has to do with temp objects, which are co-managed by > R, so this is hard to sort out. > > | Rcpp::DataFrame can handle so big DataFrame. In my opinion, n = 4e5 is > not big, > | I can create such a long data.frame from R code easily, without any > problem. > | Why Rcpp can not? Or I miss something? > > You are welcome to debug it. Maybe valgrind will help. > > Or if you don't want to or can't, just return a list of vectors and call > as.data.frame() on it when you back in R. > > That's what we used to do anyway before we added the convenience wrapping. > > Dirk > > | ---------------------------------------------------------------------- > | _______________________________________________ > | Rcpp-devel mailing list > | [email protected] > | https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel > -- > Dirk Eddelbuettel | [email protected] | http://dirk.eddelbuettel.com >
_______________________________________________ Rcpp-devel mailing list [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
