Data.table: Document when exactly the column names from `j` are preserved

Created on 23 Dec 2018  ·  4Comments  ·  Source: Rdatatable/data.table

Here is a Stack Overflow question I asked about the rules for when column names from j appear in the output, with some surprising examples. It's received three incomplete answers, two of which have been deleted. Clearly, when j is a named list, the given names are retained. Otherwise, it's not clear under which circumstances data.table will guess the column names.

(The contributing guidelines say I should add an issue label, but I don't seem to have permission to do that.)

All 4 comments

thanks for the report! you're right that it's a bit hard to predict. there
are some existing issues about fixing the inconsistency, which is
preferable to enumerating all the nooks and crannies of something which is
admittedly flawed.

for now, just use a named list... there's also something to be said for the
readability of explicit naming...

I'm not at a computer so can't track down those issues... if someone can we
can close this as duplicate

On Sun, Dec 23, 2018, 12:53 PM Kodi Arfer <[email protected] wrote:

Here
https://stackoverflow.com/questions/53745905/when-exactly-does-data-table-preserve-column-names
is a Stack Overflow question I asked about the rules for when column names
from j appear in the output, with some surprising examples. It's received
three incomplete answers, two of which have been deleted. Clearly, when j
is a named list, the given names are retained. Otherwise, it's not clear
under which circumstances data.table will guess the column names.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/Rdatatable/data.table/issues/3244, or mute the thread
https://github.com/notifications/unsubscribe-auth/AHQQdUnVzNLGos_kMP8QEh9DFOcloQh8ks5u76cWgaJpZM4Zf5EM
.

there are some existing issues about fixing the inconsistency, which is preferable to enumerating all the nooks and crannies of something which is admittedly flawed.

Makes sense; it might even be easier to simplify the actual rules and then explain those than to explain them as-is.

Thanks @Henrik-P I'll close now

Was this page helpful?
0 / 5 - 0 ratings