<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; margin: 0px; line-height: auto;">I encountered the following behavior with data.table 1.8.10 on R 3.0.2 on Mac OS X and was wondering if that is expected:</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="margin: 0px; "><div id="bloop_customfont" style="margin: 0px; "><font face="Courier New">> dt1 = data.table(a=character())</font></div><div id="bloop_customfont" style="margin: 0px; "><font face="Courier New">> dt2 = data.table(a=character())</font></div><div id="bloop_customfont" style="margin: 0px; "><div id="bloop_customfont" style="margin: 0px; "><font face="Courier New">> dt1</font></div><div id="bloop_customfont" style="margin: 0px; "><font face="Courier New">Empty data.table (0 rows) of 1 col: a</font></div><div id="bloop_customfont" style="margin: 0px; "><span style="font-family: 'Courier New'; ">> colnames(dt1)</span></div><div id="bloop_customfont" style="margin: 0px; "><font face="Courier New">[1] "a"</font></div><div id="bloop_customfont" style="margin: 0px; "><font face="Courier New">> dt2</font></div><div id="bloop_customfont" style="margin: 0px; "><font face="Courier New">Empty data.table (0 rows) of 1 col: a</font></div><div id="bloop_customfont" style="margin: 0px; "><span style="font-family: 'Courier New'; ">> colnames(dt2)</span></div><div id="bloop_customfont" style="margin: 0px; "><font face="Courier New">[1] "a"</font></div><div id="bloop_customfont" style="margin: 0px; "><font face="Courier New">> rbind(dt1, dt2)</font></div><div id="bloop_customfont" style="margin: 0px; "><font face="Courier New">Error in setnames(ret, nm.original) : x has no column names</font></div><div id="bloop_customfont" style="margin: 0px; "><font face="Courier New"><br></font></div><div id="bloop_customfont" style="margin: 0px; "><font face="Courier New">Enter a frame number, or 0 to exit </font></div><div id="bloop_customfont" style="margin: 0px; "><font face="Courier New"><br></font></div><div id="bloop_customfont" style="margin: 0px; "><font face="Courier New">1: rbind(dt1, dt2)</font></div><div id="bloop_customfont" style="margin: 0px; "><font face="Courier New">2: rbind(deparse.level, ...)</font></div><div id="bloop_customfont" style="margin: 0px; "><font face="Courier New">3: data.table::.rbind.data.table(...)</font></div><div id="bloop_customfont" style="margin: 0px; "><font face="Courier New">4: setnames(ret, nm.original)</font></div><div id="bloop_customfont" style="margin: 0px; "><br></div><div id="bloop_customfont" style="margin: 0px; "><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px; ">If I rbind two zero-row data.table objects with matching column names, I would have expected to get a zero-row data.table back (0 + 0 = 0, after all).</div></div></div></div><br><div class="" id="bloop_sign_1380571025722400000"><span style="font-family:helvetica,arial;font-size:13px"></span><div style="font-family: Helvetica; line-height: normal; ">-- </div><div style="font-family: Helvetica; line-height: normal; "><span style="font-family: arial; font-size: small; ">Alexandre Sieira</span><br style="font-family: arial; font-size: small; "><span style="font-family: arial; font-size: small; ">CISA, CISSP, ISO 27001 Lead Auditor</span><br style="font-family: arial; font-size: small; "><br style="font-family: arial; font-size: small; "><span style="font-family: arial; font-size: small; ">"The truth is rarely pure and never simple."</span><br style="font-family: arial; font-size: small; "><span style="font-family: arial; font-size: small; ">Oscar Wilde, The Importance of Being Earnest, 1895, Act I</span></div></div></body></html>