{"action":"created","issue":{"url":"https://api.github.com/repos/hadley/dplyr/issues/1196","labels_url":"https://api.github.com/repos/hadley/dplyr/issues/1196/labels{/name}","comments_url":"https://api.github.com/repos/hadley/dplyr/issues/1196/comments","events_url":"https://api.github.com/repos/hadley/dplyr/issues/1196/events","html_url":"https://github.com/hadley/dplyr/issues/1196","id":84602389,"number":1196,"title":"row_number()","user":{"login":"matthieugomez","id":6223837,"avatar_url":"https://avatars.githubusercontent.com/u/6223837?v=3","gravatar_id":"","url":"https://api.github.com/users/matthieugomez","html_url":"https://github.com/matthieugomez","followers_url":"https://api.github.com/users/matthieugomez/followers","following_url":"https://api.github.com/users/matthieugomez/following{/other_user}","gists_url":"https://api.github.com/users/matthieugomez/gists{/gist_id}","starred_url":"https://api.github.com/users/matthieugomez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthieugomez/subscriptions","organizations_url":"https://api.github.com/users/matthieugomez/orgs","repos_url":"https://api.github.com/users/matthieugomez/repos","events_url":"https://api.github.com/users/matthieugomez/events{/privacy}","received_events_url":"https://api.github.com/users/matthieugomez/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-03T14:47:02Z","updated_at":"2015-06-03T21:27:19Z","closed_at":null,"body":"It would be great to be able to use row_number() instead of row_number(x) in a data.frame\r\n\r\n```R\r\ndf <- data_frame(\r\n   id = c(1,1,1,1,2,2),\r\n   v1 = c(12,10,15,20,40,30)\r\n)\r\n```\r\n\r\nTo select only one row by `id` with the maximum value for `v1` , one has to write\r\n```\r\ndf %>% group_by(id) %>% filter(order_by(v, row_number(v)) == 1)\r\n```\r\nBut it seems more intuitive to write\r\n```\r\ndf %>% group_by(id) %>% filter(order_by(v, row_number()) == 1)\r\n```"},"comment":{"url":"https://api.github.com/repos/hadley/dplyr/issues/comments/108620315","html_url":"https://github.com/hadley/dplyr/issues/1196#issuecomment-108620315","issue_url":"https://api.github.com/repos/hadley/dplyr/issues/1196","id":108620315,"user":{"login":"matthieugomez","id":6223837,"avatar_url":"https://avatars.githubusercontent.com/u/6223837?v=3","gravatar_id":"","url":"https://api.github.com/users/matthieugomez","html_url":"https://github.com/matthieugomez","followers_url":"https://api.github.com/users/matthieugomez/followers","following_url":"https://api.github.com/users/matthieugomez/following{/other_user}","gists_url":"https://api.github.com/users/matthieugomez/gists{/gist_id}","starred_url":"https://api.github.com/users/matthieugomez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthieugomez/subscriptions","organizations_url":"https://api.github.com/users/matthieugomez/orgs","repos_url":"https://api.github.com/users/matthieugomez/repos","events_url":"https://api.github.com/users/matthieugomez/events{/privacy}","received_events_url":"https://api.github.com/users/matthieugomez/received_events","type":"User","site_admin":false},"created_at":"2015-06-03T21:27:19Z","updated_at":"2015-06-03T21:27:19Z","body":"Oh I got confused.\r\n```\r\ndf %>% group_by(id) %>% filter(row_number(v1) == 1)\r\n```"}}