I think you know how to make a wrapper. Consider something like

setDT(setnames(lapply(coltypes,function(x){ if (x=="char")
return(character(0)); if (x=="numeric") return(numeric(0))}),colnames))

On Thu, Jul 23, 2015 at 2:34 PM, statquant3 <[email protected]> wrote:

> Doing DT <- data.table(date=Sys.Date()[0],id=character(0),value=numeric(0))
> is exactly what I want to do... programatically.
> I just want to provide column names and type of columns...
>
>
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/create-empty-data-table-tp4710237p4710261.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
>
_______________________________________________
datatable-help mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help

Reply via email to