There is nothing already written that I'm aware of, but you can create an empty dt easily by edt = data.table (a = numeric(0), b = character(0)), that is, by providing arguments of 0 length as column. Writing a function that wraps that isn't difficult.
On Thu, Jul 23, 2015, 07:00 < [email protected]> wrote: > Send datatable-help mailing list submissions to > [email protected] > > To subscribe or unsubscribe via the World Wide Web, visit > > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help > > or, via email, send a message with subject or body 'help' to > [email protected] > > You can reach the person managing the list at > [email protected] > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of datatable-help digest..." > > > Today's Topics: > > 1. Any date for 1.9.6 push to CRAN? (Damian Betebenner) > 2. create empty data.table (statquant3) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 22 Jul 2015 10:10:31 +0000 > From: Damian Betebenner <[email protected]> > To: "[email protected]" > <[email protected]> > Subject: [datatable-help] Any date for 1.9.6 push to CRAN? > Message-ID: <[email protected]> > Content-Type: text/plain; charset="us-ascii" > > Hi all, > > It was mentioned recently that 1.9.6 would be pushed to CRAN soon. Any > rough dates when that might occur? > > Alway appreciative for the great work! > > Damian > > ------------------------------ > > Message: 2 > Date: Thu, 23 Jul 2015 02:51:14 -0700 (PDT) > From: statquant3 <[email protected]> > To: [email protected] > Subject: [datatable-help] create empty data.table > Message-ID: <[email protected]> > Content-Type: text/plain; charset=us-ascii > > I wanted to create a function that creates an empty data.table with > specified > column types. > emptyDT <- function(colNames,colTypes){...} > I would call > emptyDT(c('date','id','value'),c('Date','Character','Numeric')) > > Is there something available for this already ? > > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/create-empty-data-table-tp4710237.html > Sent from the datatable-help mailing list archive at Nabble.com. > > > ------------------------------ > > _______________________________________________ > datatable-help mailing list > [email protected] > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help > > End of datatable-help Digest, Vol 65, Issue 5 > ********************************************* >
_______________________________________________ datatable-help mailing list [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
