[Rcpp-devel] Construct data.table object at the C++ level ?

Dirk Eddelbuettel edd at debian.org
Fri Nov 3 05:24:27 CET 2017


On 2 November 2017 at 15:36, Matt Dowle wrote:
| I replied in the issue.

So did I, now that I am back online after a company event.

I'll fill a simple concrete event: constructing a DT from a DF and then using
nanotime to construct sane nanotime/bit64 objects.   All fine and trivial,
but would be nicer to do this -- and more -- and the C++ level.

| I don't know what you're asking for here.  A data.table is a list of
| same-length vectors, so it's almost trivial to create.  Then just add the

We understand that part.

We are less sure about to get to the bits that are not data.frame, and how to
do so at the C level.

Dirk

| attributes which setDT() does from R level, and trace that through to see
| what it does.  I don't really get what you're asking for as on the face of
| it it's simple.  I had asked in the issue about whether it's the recycling
| you need but I'm not clear.
| 
| On Thu, Nov 2, 2017 at 2:35 PM, Dirk Eddelbuettel <edd at debian.org> wrote:
| 
| >
| > Does anybody have any (public) code constructing data.table objects?
| >
| > I can of course do as we do for data.frame, which is (essentially)
| > constructing a List and setting a class attribute at end.  But I gather
| > someone may have done something somewhere already?  C code works too,
| > making
| > it shorter always works...
| >
| > Dirk
| >
| > PS Long-parked related  wishlist ticket is at
| > https://github.com/Rdatatable/data.table/issues/1694
| >
| > --
| > http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
| >

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org


More information about the Rcpp-devel mailing list