<div>
Steve,
</div><div>Maybe, but it's just getting started :) - we now have to decide what's ambiguous! </div><div>Ex: Is subsetting by column number considered ambiguous (By definition of ambiguous, probably not)? But then it'd be inconsistent with subsetting when column names are provided.. So, should we prioritise consistency over function in this scenario?</div><div><br></div>
<div><div><br></div><div>Arun</div><div><br></div></div>
<p style="color: #A0A0A8;">On Friday, November 8, 2013 at 9:16 PM, Steve Lianoglou wrote:</p>
<blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
<span><div><div><div>Wow ... did we just reach a consensus? :-)</div><div><br></div><div>-steve</div><div><br></div><div>On Fri, Nov 8, 2013 at 12:08 PM, Eduard Antonyan</div><div><<a href="mailto:eduard.antonyan@gmail.com">eduard.antonyan@gmail.com</a>> wrote:</div><blockquote type="cite"><div><div>Ditto - having dups, but spitting out an error on all ambiguous operations</div><div>seems like a robust strategy.</div><div><br></div><div><br></div><div>On Fri, Nov 8, 2013 at 2:02 PM, Steve Lianoglou <<a href="mailto:lianoglou.steve@gene.com">lianoglou.steve@gene.com</a>></div><div>wrote:</div><blockquote type="cite"><div><div><br></div><div>Hi,</div><div><br></div><div>I wanted to point out that I'm in Arun's camp on this one:</div><div><br></div><div>On Fri, Nov 8, 2013 at 7:09 AM, Arunkumar Srinivasan</div><div><<a href="mailto:aragorn168b@gmail.com">aragorn168b@gmail.com</a>> wrote:</div><div><br></div><blockquote type="cite"><div><div>In my opinion, the dup-names should be allowed *only* during creation of</div><div>data.table, and setting names (using `setnames`, `setattr` or the bad</div><div>form</div><div>`names(dt) <- `). Other than that, *ALL* operations should fail (end up</div><div>in</div><div>error), and that includes subsetting operation. The `setnames` gives the</div><div>option for the user to set the names back before writing to a file,</div><div>should</div><div>he choose to keep it at the end.</div><div><br></div><div>I think it's much better this way (strict, but avoids confusion). For</div><div>example, in data.frames, doing DF$x (when x occurs twice) implicitly</div><div>prints</div><div>only the first (no warning/error). Also, split(DF$x, DF$x) uses the</div><div>first</div><div>column and so does split(DF, DF$x).</div></div></blockquote><div><br></div><div>As an opinionated footnote: I can acquiesce that since data.frames</div><div>allow duplicated column names, I *guess* data.table should *allow*</div><div>them, however as is clear (to me) from this long chain of</div><div>"possibilities" that one can do, I strongly feel that computing over a</div><div>data.table w/ duplicated columns is a fundamentally broken idea as it</div><div>is ambiguous as to what the right behavior should be ... forget about</div><div>even the (surely fun) book-keeping code required to make it happen.</div><div><br></div><div>You want to import a table with duplicate names? Fine (we should warn</div><div>on import if it was `fread` or `as.data.table`d).</div><div><br></div><div>You want to set some names to duplicates? Fine -- warn there too.</div><div><br></div><div>Want to do any computation inside the data.table via `j` or as a</div><div>column in `by`? Throw an error and punt the problem to the user to</div><div>figure out how they would like to disambiguate the first column named</div><div>"a" from the 10th one -- I don't think we need another FAQ explaining</div><div>what "the right" way that this should be done is, and why we picked</div><div>it.</div><div><br></div><div>Or if you really want to compute over a data.table with duplicate</div><div>names, you might be better served by having the table in "long" format</div><div>-- perhaps that's why there are duplicate column names to begin with</div><div>(I'm guessing -- I still don't think I would ever want to have duped</div><div>names on purpose)</div><div><br></div><div>My two cents,</div><div><br></div><div>-steve</div><div><br></div><div>--</div><div>Steve Lianoglou</div><div>Computational Biologist</div><div>Bioinformatics and Computational Biology</div><div>Genentech</div><div>_______________________________________________</div><div>datatable-help mailing list</div><div><a href="mailto:datatable-help@lists.r-forge.r-project.org">datatable-help@lists.r-forge.r-project.org</a></div><div><br></div><div><a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help</a></div></div></blockquote><div><br></div><div><br></div><div><br></div><div>_______________________________________________</div><div>datatable-help mailing list</div><div><a href="mailto:datatable-help@lists.r-forge.r-project.org">datatable-help@lists.r-forge.r-project.org</a></div><div><a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help</a></div></div></blockquote><div><br></div><div><br></div><div><br></div><div>-- </div><div>Steve Lianoglou</div><div>Computational Biologist</div><div>Bioinformatics and Computational Biology</div><div>Genentech</div><div>_______________________________________________</div><div>datatable-help mailing list</div><div><a href="mailto:datatable-help@lists.r-forge.r-project.org">datatable-help@lists.r-forge.r-project.org</a></div><div><a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help</a></div></div></div></span>
</blockquote>
<div>
<br>
</div>