Re: [Rcpp-devel] Additional constructors for DataFrame

2012-11-26 Thread Dirk Eddelbuettel
On 26 November 2012 at 12:39, Davor Cubranic wrote: | `create` is only useful if I know the contents of the data frame at compile | time. In this case, until runtime I don't know how many columns there are, | their names, types, or the number of rows -- except that all columns have the | same numb

Re: [Rcpp-devel] Additional constructors for DataFrame

2012-11-26 Thread Davor Cubranic
On 2012-11-26, at 1:10 AM, [email protected] wrote: > 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 t

Re: [Rcpp-devel] Additional constructors for DataFrame

2012-11-26 Thread romain
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 ar

[Rcpp-devel] Additional constructors for DataFrame

2012-11-25 Thread Davor Cubranic
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. Yes, I can always create a List first and convert it to a DataFrame afterwards, but this actually doesn't copy some attri