{"action":"created","issue":{"url":"https://api.github.com/repos/Rdatatable/data.table/issues/1807","repository_url":"https://api.github.com/repos/Rdatatable/data.table","labels_url":"https://api.github.com/repos/Rdatatable/data.table/issues/1807/labels{/name}","comments_url":"https://api.github.com/repos/Rdatatable/data.table/issues/1807/comments","events_url":"https://api.github.com/repos/Rdatatable/data.table/issues/1807/events","html_url":"https://github.com/Rdatatable/data.table/issues/1807","id":170553739,"number":1807,"title":"non-equi join returning incorrect column name?","user":{"login":"SymbolixAU","id":18344164,"avatar_url":"https://avatars.githubusercontent.com/u/18344164?v=3","gravatar_id":"","url":"https://api.github.com/users/SymbolixAU","html_url":"https://github.com/SymbolixAU","followers_url":"https://api.github.com/users/SymbolixAU/followers","following_url":"https://api.github.com/users/SymbolixAU/following{/other_user}","gists_url":"https://api.github.com/users/SymbolixAU/gists{/gist_id}","starred_url":"https://api.github.com/users/SymbolixAU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SymbolixAU/subscriptions","organizations_url":"https://api.github.com/users/SymbolixAU/orgs","repos_url":"https://api.github.com/users/SymbolixAU/repos","events_url":"https://api.github.com/users/SymbolixAU/events{/privacy}","received_events_url":"https://api.github.com/users/SymbolixAU/received_events","type":"User","site_admin":false},"labels":[{"id":184075097,"url":"https://api.github.com/repos/Rdatatable/data.table/labels/Enhancement","name":"Enhancement","color":"bfe5bf","default":false},{"id":105327033,"url":"https://api.github.com/repos/Rdatatable/data.table/labels/internals","name":"internals","color":"009800","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-08-11T01:20:39Z","updated_at":"2016-11-15T16:08:27Z","closed_at":"2016-11-15T16:08:27Z","body":"When performing a non-equi join (in v1.9.7) on columns with different names, the returned column is given the name of the table on the left of the join, but contains values from the table on the right of the join - is this by design?\n\n```\n## baseline example where the join columns have the same name\nlibrary(data.table)\n\ndt1 <- data.table(id = c(1,2,3),\n                val = c(1,2,3))\n\ndt2 <- data.table(id = c(1,2,3),\n                val = c(2,3,4))\n\n## the returned 'val' column comes from the table inside [ \n## - shown by the val == 4 (as it only exists in dt2)\ndt1[ dt2, on = .(val < val), nomatch = 0]\n#    id val i.id\n#1:  1   2    1\n#2:  1   3    2\n#3:  2   3    2\n#4:  1   4    3\n#5:  2   4    3\n#6:  3   4    3\n\n\n## When join columns have different names,\n## the returned column name is from the column outside [\ndt1 <- data.table(id = c(1,2,3),\n                val1 = c(1,2,3))\n\ndt2 <- data.table(id = c(1,2,3),\n                val2 = c(2,3,4))\n\ndt1[ dt2, on = .(val1 < val2), nomatch = 0]\n\n#   id val1 i.id\n#1:  1    2    1\n#2:  1    3    2\n#3:  2    3    2\n#4:  1    4    3\n#5:  2    4    3\n#6:  3    4    3\n```\n"},"comment":{"url":"https://api.github.com/repos/Rdatatable/data.table/issues/comments/260684231","html_url":"https://github.com/Rdatatable/data.table/issues/1807#issuecomment-260684231","issue_url":"https://api.github.com/repos/Rdatatable/data.table/issues/1807","id":260684231,"user":{"login":"jangorecki","id":3627377,"avatar_url":"https://avatars.githubusercontent.com/u/3627377?v=3","gravatar_id":"","url":"https://api.github.com/users/jangorecki","html_url":"https://github.com/jangorecki","followers_url":"https://api.github.com/users/jangorecki/followers","following_url":"https://api.github.com/users/jangorecki/following{/other_user}","gists_url":"https://api.github.com/users/jangorecki/gists{/gist_id}","starred_url":"https://api.github.com/users/jangorecki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jangorecki/subscriptions","organizations_url":"https://api.github.com/users/jangorecki/orgs","repos_url":"https://api.github.com/users/jangorecki/repos","events_url":"https://api.github.com/users/jangorecki/events{/privacy}","received_events_url":"https://api.github.com/users/jangorecki/received_events","type":"User","site_admin":false},"created_at":"2016-11-15T16:08:27Z","updated_at":"2016-11-15T16:08:27Z","body":"agree with @eantonya, closing as duplicate."}}
{"actor":{"display_login":"jangorecki"}}