<html><body><div><br><br>On Jan 15, 2013, at 03:38 PM, John Merrill <john.merrill@gmail.com> wrote:<br><br></div><div><blockquote type="cite"><div class="msg-quote"><div dir="ltr">You're confusing a data frame object with the data.frame coercion function.  Data frames themselves are fast to access.  The coercion function is not.</div><div class="gmail_extra"></div></div></blockquote><span> </span></div><div>Ah, I see what you mean.<br><blockquote type="cite"><div class="msg-quote"><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jan 15, 2013 at 7:36 AM, Yan Zhou <span dir="ltr"><<a href="mailto:zhouyan@me.com" data-mce-href="mailto:zhouyan@me.com">zhouyan@me.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" data-mce-style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;"><div><div>I am curious what usage of data.frame give you the conclusion that it is slow. You must know that data.frame IS a list of variables, which can be vectors (though not always) and can only be faster than a list of lists.</div><div><br></div><div>Best,</div><div><br></div><div>Yan<div><div class="h5"><br><br>On Jan 15, 2013, at 03:20 PM, John Merrill <<a href="mailto:john.merrill@gmail.com" data-mce-href="mailto:john.merrill@gmail.com">john.merrill@gmail.com</a>> wrote:<br> <br></div></div></div><div><blockquote type="cite"><div><div><div class="h5"><div dir="ltr">It appears that DataFrame::create is a thin layer on top of the R data.frame call.  The guarantee correctness, but also means the performance of an Rcpp routine which returns a large data frame is limited by the performance of data.frame -- which is utterly horrible.<div><br></div><div>In the current version of R, there's a trivial, but borderline evil, work around: build a list of lists meeting the basic requirements of a data frame (they all need to be of the same length, and each component list needs to be named) and set the type of the object to "data.frame".   </div><div><br></div><div>I have two questions:</div><div>(1) Is it reasonable to anticipate that this hack will continue to work for the near future in R?</div><div>(2) If so, would a patch to that effect be of interest to the developers?  </div></div></div></div><div>_______________________________________________<br> Rcpp-devel mailing list<br> <a href="mailto:Rcpp-devel@lists.r-forge.r-project.org" data-mce-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" data-mce-href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a></div></div></blockquote></div></div></blockquote></div><br></div></div></blockquote></div></body></html>