{"action":"created","issue":{"url":"https://api.github.com/repos/Rdatatable/data.table/issues/1475","labels_url":"https://api.github.com/repos/Rdatatable/data.table/issues/1475/labels{/name}","comments_url":"https://api.github.com/repos/Rdatatable/data.table/issues/1475/comments","events_url":"https://api.github.com/repos/Rdatatable/data.table/issues/1475/events","html_url":"https://github.com/Rdatatable/data.table/issues/1475","id":123183026,"number":1475,"title":"Feature Request: pass columns to function ``merge`` ","user":{"login":"ptoche","id":6339274,"avatar_url":"https://avatars.githubusercontent.com/u/6339274?v=3","gravatar_id":"","url":"https://api.github.com/users/ptoche","html_url":"https://github.com/ptoche","followers_url":"https://api.github.com/users/ptoche/followers","following_url":"https://api.github.com/users/ptoche/following{/other_user}","gists_url":"https://api.github.com/users/ptoche/gists{/gist_id}","starred_url":"https://api.github.com/users/ptoche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ptoche/subscriptions","organizations_url":"https://api.github.com/users/ptoche/orgs","repos_url":"https://api.github.com/users/ptoche/repos","events_url":"https://api.github.com/users/ptoche/events{/privacy}","received_events_url":"https://api.github.com/users/ptoche/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-20T21:00:57Z","updated_at":"2015-12-21T01:08:04Z","closed_at":null,"body":"    # make a data.table\r\n    set.seed(1)\r\n    dt <- data.table(id = 1:5, x1 = 1:5, x2 = 5:1, x3 = round(runif(5, 1, 5), 0), key = \"id\")\r\n\r\nI can merge with quoted column names:\r\n\r\n    merge(dt, dt, by = c(\"x1\", \"x2\"))\r\n    ##       id x1 x2 x3\r\n    ##1:  1  1  5  2\r\n    ##2:  2  2  4  2\r\n    ##3:  3  3  3  3\r\n    ##4:  4  4  2  5\r\n    ##5:  5  5  1  2\r\n\r\n(silly example that was!) but not directly with a vector of columns:\r\n\r\n    merge(dt, dt, by = c(x1, x2))\r\n    ##Error in merge.data.table(dt, dt, by = c(x1, x2)) : object 'x1' not found\r\n\r\nThe function ``subset`` accepts both ``c(x1, x2)`` and ``c(\"x1\", \"x2\")`` so why not ``merge`` ?"},"comment":{"url":"https://api.github.com/repos/Rdatatable/data.table/issues/comments/166169988","html_url":"https://github.com/Rdatatable/data.table/issues/1475#issuecomment-166169988","issue_url":"https://api.github.com/repos/Rdatatable/data.table/issues/1475","id":166169988,"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":"2015-12-21T01:08:04Z","updated_at":"2015-12-21T01:08:04Z","body":"data.table aims to keep reasonable and still convenient consistency with base R functions. Proposed extension would break current `merge.data.table` consistency with `merge.data.frame` without adding additional optional argument to define a scope - as you may have `x1` and `x2` variables defined in parent scope."}}