[Rcpp-devel] Performance question about DataFrame

Yan Zhou zhouyan at me.com
Tue Jan 15 16:44:56 CET 2013



On Jan 15, 2013, at 03:38 PM, John Merrill <john.merrill at gmail.com> wrote:

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.
 
Ah, I see what you mean.


On Tue, Jan 15, 2013 at 7:36 AM, Yan Zhou <zhouyan at me.com> wrote:
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.

Best,

Yan


On Jan 15, 2013, at 03:20 PM, John Merrill <john.merrill at gmail.com> wrote:

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.

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".   

I have two questions:
(1) Is it reasonable to anticipate that this hack will continue to work for the near future in R?
(2) If so, would a patch to that effect be of interest to the developers?  
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel at lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130115/d33495ad/attachment.html>


More information about the Rcpp-devel mailing list