<div dir="ltr">Having duplicate names is allowed and not that unusual in data.table framework, so there is no need to signal anything here.<div><br></div><div>A different question is whether there should be a warning here:</div>

<div><br></div><div>  dt = data.table(a = 1, a = 2)</div><div>  dt[, a]</div><div><br></div><div>and I think that'd be a pretty good FR to have.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 1, 2013 at 4:49 PM, Alexandre Sieira <span dir="ltr"><<a href="mailto:alexandre.sieira@gmail.com" target="_blank">alexandre.sieira@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">

I found this behavior during a debugging session: </div><div style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">

<div style="margin:0px">> d = data.table(a=1, b=2, c=3)</div><div style="margin:0px">> setnames(d, "a", "b")</div><div style="margin:0px">> d</div><div style="margin:0px">   b b c</div><div style="margin:0px">

1: 1 2 3</div><div style="margin:0px"><br></div><div style="margin:0px">Shouldn’t setnames() check if the new column names already exist before renaming, and signal an error or at least a warning if they do?</div></div><span class="HOEnZb"><font color="#888888"><br>

<div><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></font></span></div><br>_______________________________________________<br>
datatable-help mailing list<br>
<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" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help</a><br></blockquote></div><br></div>