{"action":"created","issue":{"url":"https://api.github.com/repos/hadley/plyr/issues/272","repository_url":"https://api.github.com/repos/hadley/plyr","labels_url":"https://api.github.com/repos/hadley/plyr/issues/272/labels{/name}","comments_url":"https://api.github.com/repos/hadley/plyr/issues/272/comments","events_url":"https://api.github.com/repos/hadley/plyr/issues/272/events","html_url":"https://github.com/hadley/plyr/issues/272","id":139517400,"number":272,"title":"Special variables 'i' and 'n' in d_ply functions used with summarise/mutate","user":{"login":"tzoltak","id":5802266,"avatar_url":"https://avatars.githubusercontent.com/u/5802266?v=3","gravatar_id":"","url":"https://api.github.com/users/tzoltak","html_url":"https://github.com/tzoltak","followers_url":"https://api.github.com/users/tzoltak/followers","following_url":"https://api.github.com/users/tzoltak/following{/other_user}","gists_url":"https://api.github.com/users/tzoltak/gists{/gist_id}","starred_url":"https://api.github.com/users/tzoltak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tzoltak/subscriptions","organizations_url":"https://api.github.com/users/tzoltak/orgs","repos_url":"https://api.github.com/users/tzoltak/repos","events_url":"https://api.github.com/users/tzoltak/events{/privacy}","received_events_url":"https://api.github.com/users/tzoltak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-09T09:05:15Z","updated_at":"2016-03-11T08:38:16Z","closed_at":null,"body":"It seems that when summarise() or mutate() is used along with d.ply functions there are two special variables: 'n' and 'i' that describe overall number of groups and consecutive number of group. These variables mask global variables of the same names which someone pottentialy may want to use in formulas to construct new variables with summarise() or mutate(). I know that's rather unusual (perhaps even quirky) case and I don't advocate for change of this behavior. However it would be good idea to mention about it in documentation of summarise() and mutate()."},"comment":{"url":"https://api.github.com/repos/hadley/plyr/issues/comments/195258071","html_url":"https://github.com/hadley/plyr/issues/272#issuecomment-195258071","issue_url":"https://api.github.com/repos/hadley/plyr/issues/272","id":195258071,"user":{"login":"tzoltak","id":5802266,"avatar_url":"https://avatars.githubusercontent.com/u/5802266?v=3","gravatar_id":"","url":"https://api.github.com/users/tzoltak","html_url":"https://github.com/tzoltak","followers_url":"https://api.github.com/users/tzoltak/followers","following_url":"https://api.github.com/users/tzoltak/following{/other_user}","gists_url":"https://api.github.com/users/tzoltak/gists{/gist_id}","starred_url":"https://api.github.com/users/tzoltak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tzoltak/subscriptions","organizations_url":"https://api.github.com/users/tzoltak/orgs","repos_url":"https://api.github.com/users/tzoltak/repos","events_url":"https://api.github.com/users/tzoltak/events{/privacy}","received_events_url":"https://api.github.com/users/tzoltak/received_events","type":"User","site_admin":false},"created_at":"2016-03-11T08:38:16Z","updated_at":"2016-03-11T08:38:16Z","body":"Thanks, but you missed my point. When you know that d.ply() with summarise()/mutate() do such a thing, there are many simple ways to make your code working as you wish. The problem is, that it is rather hard to find out, what causes your code working wrong when this behavior isn't documented."}}