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.
On Tue, Jan 15, 2013 at 7:36 AM, Yan Zhou <zhou...@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.merr...@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@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel > >
_______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel