[Rcpp-devel] Additional constructors for DataFrame

romain at r-enthusiasts.com romain at r-enthusiasts.com
Mon Nov 26 10:10:09 CET 2012


Le 2012-11-26 06:19, Davor Cubranic a écrit :
> Although DataFrame is a subclass of List, it's missing a few handy
> constructors that List (i.e., Vector) have, such as "(const int&
> size)" to pre-allocate the space for it.

So that you would have `size` columns, but how many rows, of which 
types are the rows.

I'd suggest you have a look at one of the DataFrame::create

> Yes, I can always create a List first and convert it to a DataFrame
> afterwards, but this actually doesn't copy some attributes from the
> original List. (I noticed it for "row.names", but there may be
> others.)
>
> I'd be happy to submit a small patch, but wanted to check here first
> if I'm missing any potential problems around these constructors and
> that's the reason why they are not available for DataFrames.
>
> Thanks,
>
> Davor




More information about the Rcpp-devel mailing list