<div dir="ltr">I think you know how to make a wrapper. Consider something likeĀ <br><br>setDT(setnames(lapply(coltypes,function(x){ if (x=="char") return(character(0)); if (x=="numeric") return(numeric(0))}),colnames))<div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 23, 2015 at 2:34 PM, statquant3 <span dir="ltr"><<a href="mailto:statquant@outlook.com" target="_blank">statquant@outlook.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Doing DT <- data.table(date=Sys.Date()[0],id=character(0),value=numeric(0))<br>
is exactly what I want to do... programatically.<br>
I just want to provide column names and type of columns...<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://r.789695.n4.nabble.com/create-empty-data-table-tp4710237p4710261.html" rel="noreferrer" target="_blank">http://r.789695.n4.nabble.com/create-empty-data-table-tp4710237p4710261.html</a><br>
<span class="">Sent from the datatable-help mailing list archive at Nabble.com.<br>
_______________________________________________<br>
datatable-help mailing list<br>
</span><a href="mailto:datatable-help@lists.r-forge.r-project.org">datatable-help@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help" rel="noreferrer" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help</a><br>
</blockquote></div><br></div></div>