{"action":"created","issue":{"url":"https://api.github.com/repos/andrewpbray/oiLabs-dplyr-ggplot/issues/46","repository_url":"https://api.github.com/repos/andrewpbray/oiLabs-dplyr-ggplot","labels_url":"https://api.github.com/repos/andrewpbray/oiLabs-dplyr-ggplot/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/andrewpbray/oiLabs-dplyr-ggplot/issues/46/comments","events_url":"https://api.github.com/repos/andrewpbray/oiLabs-dplyr-ggplot/issues/46/events","html_url":"https://github.com/andrewpbray/oiLabs-dplyr-ggplot/issues/46","id":180359982,"number":46,"title":"Use of `n = n()`","user":{"login":"beanumber","id":2774211,"avatar_url":"https://avatars.githubusercontent.com/u/2774211?v=3","gravatar_id":"","url":"https://api.github.com/users/beanumber","html_url":"https://github.com/beanumber","followers_url":"https://api.github.com/users/beanumber/followers","following_url":"https://api.github.com/users/beanumber/following{/other_user}","gists_url":"https://api.github.com/users/beanumber/gists{/gist_id}","starred_url":"https://api.github.com/users/beanumber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beanumber/subscriptions","organizations_url":"https://api.github.com/users/beanumber/orgs","repos_url":"https://api.github.com/users/beanumber/repos","events_url":"https://api.github.com/users/beanumber/events{/privacy}","received_events_url":"https://api.github.com/users/beanumber/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-09-30T17:33:30Z","updated_at":"2016-10-01T20:10:39Z","closed_at":null,"body":"My students found this:\r\n```\r\nsfo_feb_flights %>%\r\n  group_by(origin) %>%\r\n  summarise(n = n())\r\n```\r\nto be really confusing. I agree. I would recommend naming the derived column `N` or `num_rows` instead of `n`, which is the name of a function!\r\n\r\nIncidentally, I am a big believer in always counting the number of rows, so I'd also recommend putting that into every `summarise()` call out of habit. "},"comment":{"url":"https://api.github.com/repos/andrewpbray/oiLabs-dplyr-ggplot/issues/comments/250934727","html_url":"https://github.com/andrewpbray/oiLabs-dplyr-ggplot/issues/46#issuecomment-250934727","issue_url":"https://api.github.com/repos/andrewpbray/oiLabs-dplyr-ggplot/issues/46","id":250934727,"user":{"login":"mine-cetinkaya-rundel","id":5965649,"avatar_url":"https://avatars.githubusercontent.com/u/5965649?v=3","gravatar_id":"","url":"https://api.github.com/users/mine-cetinkaya-rundel","html_url":"https://github.com/mine-cetinkaya-rundel","followers_url":"https://api.github.com/users/mine-cetinkaya-rundel/followers","following_url":"https://api.github.com/users/mine-cetinkaya-rundel/following{/other_user}","gists_url":"https://api.github.com/users/mine-cetinkaya-rundel/gists{/gist_id}","starred_url":"https://api.github.com/users/mine-cetinkaya-rundel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mine-cetinkaya-rundel/subscriptions","organizations_url":"https://api.github.com/users/mine-cetinkaya-rundel/orgs","repos_url":"https://api.github.com/users/mine-cetinkaya-rundel/repos","events_url":"https://api.github.com/users/mine-cetinkaya-rundel/events{/privacy}","received_events_url":"https://api.github.com/users/mine-cetinkaya-rundel/received_events","type":"User","site_admin":false},"created_at":"2016-10-01T20:10:39Z","updated_at":"2016-10-01T20:10:39Z","body":"I think @beanumber meant to say `n = n()` is confusing, where the variable name and the function are the same.\r\n\r\nI'm changing it to `n_flights = n()` in an effort to keep the var name short and specific at the same time."}}
{"actor":{"display_login":"mine-cetinkaya-rundel"}}