[datatable-help] Create empty data.table

Juan Manuel Truppia jmtruppia at gmail.com
Thu Jul 23 14:53:12 CEST 2015


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  <
datatable-help-request at lists.r-forge.r-project.org> wrote:

> Send datatable-help mailing list submissions to
>         datatable-help at lists.r-forge.r-project.org
>
> 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
>         datatable-help-request at lists.r-forge.r-project.org
>
> You can reach the person managing the list at
>         datatable-help-owner at lists.r-forge.r-project.org
>
> 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 <DBetebenner at nciea.org>
> To: "datatable-help at lists.r-forge.r-project.org"
>         <datatable-help at lists.r-forge.r-project.org>
> Subject: [datatable-help] Any date for 1.9.6 push to CRAN?
> Message-ID: <FC68AD47-F30E-4FC4-B3D6-90321CB30D4F at nciea.org>
> 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 <statquant at outlook.com>
> To: datatable-help at lists.r-forge.r-project.org
> Subject: [datatable-help] create empty data.table
> Message-ID: <1437645074911-4710237.post at n4.nabble.com>
> 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
> datatable-help at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
>
> End of datatable-help Digest, Vol 65, Issue 5
> *********************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20150723/085daa96/attachment.html>


More information about the datatable-help mailing list