Hi together,<div><br></div><div>I'm really sorry for bothering again and please let me know if I should just raise bug reports, but I understand far too less about R and data.table to know whether or not the error messages I stumble across are due to deliberate changes in v1.8.0 or just minor bugs that were introduced by that version.</div>
<div><br></div><div>Here is another one that I discovered while running old code that melted (plyr-package) a data.table. In that melt-function, unname() is called, which does not work anymore with v1.8.0:</div><div><br>
</div>
<div><div>library(data.table)</div><div>DT <- data.table(A = rep(letters[1:10], each=5),</div><div> B = rep(1:10, times=5),</div><div> C = rnorm(50))</div><div>unname(DT)</div><div><br>
</div>
<div>Error message:</div><div><br></div><div><span class="Apple-style-span" style="border-collapse:separate"><span class="Apple-style-span" style="text-align:-webkit-left"><pre tabindex="0" class="GJWPQFQDK4" style="font-family:'Lucida Console';font-size:9pt!important;outline-style:none;outline-width:initial;outline-color:initial;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;white-space:pre-wrap!important;margin-top:0px;margin-bottom:0px;line-height:1.2">
<span class="GJWPQFQDF4">Error in setnames(x, value) :
Can't assign 0 names to a 3 column data.table</span></pre><pre tabindex="0" class="GJWPQFQDK4" style="font-family:'Lucida Console';font-size:9pt!important;outline-style:none;outline-width:initial;outline-color:initial;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;white-space:pre-wrap!important;margin-top:0px;margin-bottom:0px;line-height:1.2">
<br></pre><pre tabindex="0" class="GJWPQFQDK4" style="outline-style:none;outline-width:initial;outline-color:initial;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;margin-top:0px;margin-bottom:0px">
<font face="'Lucida Console'"><span style="font-size:9pt!important;line-height:1.2;white-space:pre-wrap!important">
</span></font><div style="text-align:-webkit-auto"><font face="arial"><span style="white-space:normal">Checking out the source of unname, it's the following row that causes the problems:</span></font></div><div style="text-align:-webkit-auto">
<font face="arial"><span style="white-space:normal"><br></span></font></div><div style="text-align:-webkit-auto"><span class="Apple-style-span" style="border-collapse:separate"><span class="Apple-style-span" style="text-align:-webkit-left"><pre tabindex="0" class="GJWPQFQDK4" style="font-family:'Lucida Console';font-size:9pt!important;outline-style:none;outline-width:initial;outline-color:initial;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;white-space:pre-wrap!important;margin-top:0px;margin-bottom:0px;line-height:1.2">
<span class="GJWPQFQDB4 ace_keyword" style="color:rgb(127,0,85)">names(DT) <- NULL</span></pre><pre tabindex="0" class="GJWPQFQDK4" style="font-family:'Lucida Console';font-size:9pt!important;outline-style:none;outline-width:initial;outline-color:initial;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;white-space:pre-wrap!important;margin-top:0px;margin-bottom:0px;line-height:1.2">
<span class="GJWPQFQDB4 ace_keyword" style="color:rgb(127,0,85)"><br></span></pre><pre tabindex="0" class="GJWPQFQDK4" style="outline-style:none;outline-width:initial;outline-color:initial;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;margin-top:0px;margin-bottom:0px">
<div style="text-align:-webkit-auto"><font face="'Lucida Console'"><span style="font-size:12px;line-height:14px;white-space:pre-wrap">So I guess it's the old issue with the copying of data.tables, which is why data.table introduced setnames(). Just out of curiosity: How can one fix that? Apparently, unname is a base-R function that uses names(DT), but data.tables do not like that? So what can one do? Can one overload such base-R functions?</span></font></div>
<div style="text-align:-webkit-auto"><font face="'Lucida Console'"><span style="font-size:12px;line-height:14px;white-space:pre-wrap"><br></span></font></div><div style="text-align:-webkit-auto"><font face="'Lucida Console'"><span style="font-size:12px;line-height:14px;white-space:pre-wrap">Anyways, I hope that minimal example helps. Again, if I should raise a bug report, just let me know.</span></font></div>
<div style="text-align:-webkit-auto"><font face="'Lucida Console'"><span style="font-size:12px;line-height:14px;white-space:pre-wrap">
Christoph </span></font></div></pre></span></span></div></pre></span></span></div><br>
</div>