<div>Hi Dirk,</div><div><br></div>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.<br>
<br><div class="gmail_quote">2013/3/27 Dirk Eddelbuettel <span dir="ltr"><<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Hi,<br>
<div class="im"><br>
On 27 March 2013 at 21:19, 该走了 wrote:<br>
| Dear Rcpp developer,<br>
|   I am tried return a big DataFrame from Rcpp to R, but met some problem!<br>
<br>
</div>If you check the list archives you will see that has been discussed before.<div><div class="h5">
|  When n is big, like 4e5, then it will exhaust the memory or crash; when n is<br>
| small, like  4e3, it can return the correct DataFrame. I was wondering if<br>
<br>
</div></div>I agree.<br>
<br>
But it probably "just" has to do with temp objects, which are co-managed by<br>
R, so this is hard to sort out.<br>
<div class="im"><br>
| Rcpp::DataFrame can handle so big DataFrame. In my opinion, n = 4e5 is not big,<br>
| I can create such a long data.frame from R code easily, without any problem.<br>
| Why Rcpp can not? Or I miss something? <br>
<br>
</div>You are welcome to debug it.  Maybe valgrind will help.<br>
<br>
Or if you don't want to or can't, just return a list of vectors and call<br>
as.data.frame() on it when you back in R.<br>
<br>
That's what we used to do anyway before we added the convenience wrapping.<br>
<br>
Dirk<br>
<div><div class="h5"><br>
</div></div>| ----------------------------------------------------------------------<br>
| _______________________________________________<br>
| Rcpp-devel mailing list<br>
| <a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a><br>
| <a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
<span class="HOEnZb"><font color="#888888">--<br>
Dirk Eddelbuettel | <a href="mailto:edd@debian.org">edd@debian.org</a> | <a href="http://dirk.eddelbuettel.com" target="_blank">http://dirk.eddelbuettel.com</a><br>
</font></span></blockquote></div><br>