{"action":"created","issue":{"url":"https://api.github.com/repos/Rdatatable/data.table/issues/1966","repository_url":"https://api.github.com/repos/Rdatatable/data.table","labels_url":"https://api.github.com/repos/Rdatatable/data.table/issues/1966/labels{/name}","comments_url":"https://api.github.com/repos/Rdatatable/data.table/issues/1966/comments","events_url":"https://api.github.com/repos/Rdatatable/data.table/issues/1966/events","html_url":"https://github.com/Rdatatable/data.table/issues/1966","id":196398942,"number":1966,"title":"different behaviour of `unique()` in 1.9.8","user":{"login":"manuelreif","id":1880318,"avatar_url":"https://avatars.githubusercontent.com/u/1880318?v=3","gravatar_id":"","url":"https://api.github.com/users/manuelreif","html_url":"https://github.com/manuelreif","followers_url":"https://api.github.com/users/manuelreif/followers","following_url":"https://api.github.com/users/manuelreif/following{/other_user}","gists_url":"https://api.github.com/users/manuelreif/gists{/gist_id}","starred_url":"https://api.github.com/users/manuelreif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manuelreif/subscriptions","organizations_url":"https://api.github.com/users/manuelreif/orgs","repos_url":"https://api.github.com/users/manuelreif/repos","events_url":"https://api.github.com/users/manuelreif/events{/privacy}","received_events_url":"https://api.github.com/users/manuelreif/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-19T12:10:17Z","updated_at":"2016-12-19T12:47:28Z","closed_at":null,"body":"Hi!\r\n\r\nI am using `data.table` 1.9.8 and I noticed a different behaviour when I use `unique()` compared to the 1.9.6 version.\r\n\r\n```r\r\n# version 1.9.8\r\nlibrary(data.table)\r\nset.seed(123)\r\nDT <- data.table(x=c(1,1,1,2,2,2,3,3,3),y=rnorm(9))\r\nsetkey(DT,x)\r\nunique(DT)\r\n\r\n   x           y\r\n1: 1 -0.56047565\r\n2: 1 -0.23017749\r\n3: 1  1.55870831\r\n4: 2  0.07050839\r\n5: 2  0.12928774\r\n6: 2  1.71506499\r\n7: 3  0.46091621\r\n8: 3 -1.26506123\r\n9: 3 -0.68685285\r\n\r\n# version 1.9.6\r\n# result:\r\n\r\n   x           y\r\n1: 1 -0.56047565\r\n2: 2  0.07050839\r\n3: 3  0.46091621\r\n```\r\n\r\nThe second ('old') result is more what I expected. To get the same result as 1.9.6, I used the `by` argument, which should not be necessary following the instructions in the `unique.data.table` help file.\r\n\r\n```r\r\nunique(DT,by=\"x\")\r\n   x           y\r\n1: 1 -0.56047565\r\n2: 2  0.07050839\r\n3: 3  0.46091621\r\n```\r\n\r\nThank you!\r\nManuel"},"comment":{"url":"https://api.github.com/repos/Rdatatable/data.table/issues/comments/267956405","html_url":"https://github.com/Rdatatable/data.table/issues/1966#issuecomment-267956405","issue_url":"https://api.github.com/repos/Rdatatable/data.table/issues/1966","id":267956405,"user":{"login":"DavidArenburg","id":7597389,"avatar_url":"https://avatars.githubusercontent.com/u/7597389?v=3","gravatar_id":"","url":"https://api.github.com/users/DavidArenburg","html_url":"https://github.com/DavidArenburg","followers_url":"https://api.github.com/users/DavidArenburg/followers","following_url":"https://api.github.com/users/DavidArenburg/following{/other_user}","gists_url":"https://api.github.com/users/DavidArenburg/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidArenburg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidArenburg/subscriptions","organizations_url":"https://api.github.com/users/DavidArenburg/orgs","repos_url":"https://api.github.com/users/DavidArenburg/repos","events_url":"https://api.github.com/users/DavidArenburg/events{/privacy}","received_events_url":"https://api.github.com/users/DavidArenburg/received_events","type":"User","site_admin":false},"created_at":"2016-12-19T12:47:28Z","updated_at":"2016-12-19T12:47:28Z","body":"@franknarf1 I don't have 1.9.8 in-front of me and not sure why would anyone use a version that was released for barely a week. The 1.10.1 docs explicitly say\r\n\r\n> character or integer vector indicating which combinations of columns from x to use for uniqueness checks. By default all columns are are being used. The was changed recently for consistency to data.frame methods. In version < 1.9.8 default was key(x)."}}
{"actor":{"display_login":"DavidArenburg"}}