{"action":"created","issue":{"url":"https://api.github.com/repos/Rdatatable/data.table/issues/1290","labels_url":"https://api.github.com/repos/Rdatatable/data.table/issues/1290/labels{/name}","comments_url":"https://api.github.com/repos/Rdatatable/data.table/issues/1290/comments","events_url":"https://api.github.com/repos/Rdatatable/data.table/issues/1290/events","html_url":"https://github.com/Rdatatable/data.table/issues/1290","id":103105239,"number":1290,"title":"[Bug]merge is now merging on col order instead of name","user":{"login":"ChristK","id":5948569,"avatar_url":"https://avatars.githubusercontent.com/u/5948569?v=3","gravatar_id":"","url":"https://api.github.com/users/ChristK","html_url":"https://github.com/ChristK","followers_url":"https://api.github.com/users/ChristK/followers","following_url":"https://api.github.com/users/ChristK/following{/other_user}","gists_url":"https://api.github.com/users/ChristK/gists{/gist_id}","starred_url":"https://api.github.com/users/ChristK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChristK/subscriptions","organizations_url":"https://api.github.com/users/ChristK/orgs","repos_url":"https://api.github.com/users/ChristK/repos","events_url":"https://api.github.com/users/ChristK/events{/privacy}","received_events_url":"https://api.github.com/users/ChristK/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Rdatatable/data.table/labels/bug","name":"bug","color":"DF3A2C"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-25T20:06:57Z","updated_at":"2015-08-25T21:25:55Z","closed_at":"2015-08-25T21:25:41Z","body":"Please see example below\r\n````R\r\nrequire(data.table) #latest github version\r\n\r\nDT1 <- data.table(sex = rep(1:2, 5),\r\n                  group = rep(letters[1:5], 2),\r\n                  V1 = 1:10)\r\n\r\nDT2 <- data.table(group = rep(letters[1:5], 2), # note the different order\r\n                  sex = rep(1:2, 5),\r\n                  V2 = 1:10)\r\n\r\nmerge(\r\n  DT1, DT2, by = c(\"sex\", \"group\")\r\n)\r\n\r\n# WRONG! sex should be numbers and group letters\r\n#   sex group V1 V2\r\n# 1:   a     1  1  1\r\n# 2:   a     2  6  6\r\n# 3:   b     1  7  7\r\n# 4:   b     2  2  2\r\n# 5:   c     1  3  3\r\n# 6:   c     2  8  8\r\n# 7:   d     1  9  9\r\n# 8:   d     2  4  4\r\n# 9:   e     1  5  5\r\n#10:   e     2 10 10\r\n\r\n sessionInfo()\r\n\r\n#R version 3.2.2 (2015-08-14)\r\n#Platform: x86_64-pc-linux-gnu (64-bit)\r\n#Running under: Ubuntu 14.04.2 LTS\r\n#\r\n#locale:\r\n# [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C              \r\n# [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8    \r\n# [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8   \r\n# [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C                 \r\n# [9] LC_ADDRESS=C               LC_TELEPHONE=C            \r\n#[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       \r\n\r\n#attached base packages:\r\n#[1] stats     graphics  grDevices utils     datasets \r\n#[6] methods   base     \r\n#\r\n#other attached packages:\r\n#[1] data.table_1.9.5\r\n#\r\n#loaded via a namespace (and not attached):\r\n#[1] tools_3.2.2  chron_2.3-47\r\n````\r\nThe bug was introduced probably the last week. (Edited with simpler example)"},"comment":{"url":"https://api.github.com/repos/Rdatatable/data.table/issues/comments/134746482","html_url":"https://github.com/Rdatatable/data.table/issues/1290#issuecomment-134746482","issue_url":"https://api.github.com/repos/Rdatatable/data.table/issues/1290","id":134746482,"user":{"login":"arunsrinivasan","id":3102045,"avatar_url":"https://avatars.githubusercontent.com/u/3102045?v=3","gravatar_id":"","url":"https://api.github.com/users/arunsrinivasan","html_url":"https://github.com/arunsrinivasan","followers_url":"https://api.github.com/users/arunsrinivasan/followers","following_url":"https://api.github.com/users/arunsrinivasan/following{/other_user}","gists_url":"https://api.github.com/users/arunsrinivasan/gists{/gist_id}","starred_url":"https://api.github.com/users/arunsrinivasan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arunsrinivasan/subscriptions","organizations_url":"https://api.github.com/users/arunsrinivasan/orgs","repos_url":"https://api.github.com/users/arunsrinivasan/repos","events_url":"https://api.github.com/users/arunsrinivasan/events{/privacy}","received_events_url":"https://api.github.com/users/arunsrinivasan/received_events","type":"User","site_admin":false},"created_at":"2015-08-25T21:25:55Z","updated_at":"2015-08-25T21:25:55Z","body":"Thanks for the nice report. Fixed."}}