{"action":"created","issue":{"url":"https://api.github.com/repos/tidyverse/dplyr/issues/2916","repository_url":"https://api.github.com/repos/tidyverse/dplyr","labels_url":"https://api.github.com/repos/tidyverse/dplyr/issues/2916/labels{/name}","comments_url":"https://api.github.com/repos/tidyverse/dplyr/issues/2916/comments","events_url":"https://api.github.com/repos/tidyverse/dplyr/issues/2916/events","html_url":"https://github.com/tidyverse/dplyr/issues/2916","id":238565485,"node_id":"MDU6SXNzdWUyMzg1NjU0ODU=","number":2916,"title":".data does not work if object has same name as variable","user":{"login":"sollano","id":19754326,"node_id":"MDQ6VXNlcjE5NzU0MzI2","avatar_url":"https://avatars0.githubusercontent.com/u/19754326?v=4","gravatar_id":"","url":"https://api.github.com/users/sollano","html_url":"https://github.com/sollano","followers_url":"https://api.github.com/users/sollano/followers","following_url":"https://api.github.com/users/sollano/following{/other_user}","gists_url":"https://api.github.com/users/sollano/gists{/gist_id}","starred_url":"https://api.github.com/users/sollano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sollano/subscriptions","organizations_url":"https://api.github.com/users/sollano/orgs","repos_url":"https://api.github.com/users/sollano/repos","events_url":"https://api.github.com/users/sollano/events{/privacy}","received_events_url":"https://api.github.com/users/sollano/received_events","type":"User","site_admin":false},"labels":[{"id":674867158,"node_id":"MDU6TGFiZWw2NzQ4NjcxNTg=","url":"https://api.github.com/repos/tidyverse/dplyr/labels/docs","name":"docs","color":"0052cc","default":false}],"state":"closed","locked":false,"assignee":{"login":"lionel-","id":4465050,"node_id":"MDQ6VXNlcjQ0NjUwNTA=","avatar_url":"https://avatars2.githubusercontent.com/u/4465050?v=4","gravatar_id":"","url":"https://api.github.com/users/lionel-","html_url":"https://github.com/lionel-","followers_url":"https://api.github.com/users/lionel-/followers","following_url":"https://api.github.com/users/lionel-/following{/other_user}","gists_url":"https://api.github.com/users/lionel-/gists{/gist_id}","starred_url":"https://api.github.com/users/lionel-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lionel-/subscriptions","organizations_url":"https://api.github.com/users/lionel-/orgs","repos_url":"https://api.github.com/users/lionel-/repos","events_url":"https://api.github.com/users/lionel-/events{/privacy}","received_events_url":"https://api.github.com/users/lionel-/received_events","type":"User","site_admin":false},"assignees":[{"login":"lionel-","id":4465050,"node_id":"MDQ6VXNlcjQ0NjUwNTA=","avatar_url":"https://avatars2.githubusercontent.com/u/4465050?v=4","gravatar_id":"","url":"https://api.github.com/users/lionel-","html_url":"https://github.com/lionel-","followers_url":"https://api.github.com/users/lionel-/followers","following_url":"https://api.github.com/users/lionel-/following{/other_user}","gists_url":"https://api.github.com/users/lionel-/gists{/gist_id}","starred_url":"https://api.github.com/users/lionel-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lionel-/subscriptions","organizations_url":"https://api.github.com/users/lionel-/orgs","repos_url":"https://api.github.com/users/lionel-/repos","events_url":"https://api.github.com/users/lionel-/events{/privacy}","received_events_url":"https://api.github.com/users/lionel-/received_events","type":"User","site_admin":false}],"milestone":null,"comments":14,"created_at":"2017-06-26T14:41:39Z","updated_at":"2018-10-13T13:16:13Z","closed_at":"2018-10-13T13:16:13Z","author_association":"NONE","body":"I believe this is a bug with the ```.data``` pronoun:\r\n\r\n```r\r\n# Load package and example data\r\nlibrary(dplyr)\r\n\r\n# this works\r\n\r\nmy_var <- \"homeworld\"\r\n\r\nstarwars %>%\r\n  group_by(.data[[my_var]]) %>%\r\n  summarise_at(vars(height:mass), mean, na.rm = TRUE)\r\n\r\n# A tibble: 49 x 3\r\n           my_var   height  mass\r\n            <chr>    <dbl> <dbl>\r\n 1       Alderaan 176.3333  64.0\r\n 2    Aleen Minor  79.0000  15.0\r\n 3         Bespin 175.0000  79.0\r\n 4     Bestine IV 180.0000 110.0\r\n 5 Cato Neimoidia 191.0000  90.0\r\n 6          Cerea 198.0000  82.0\r\n 7       Champala 196.0000   NaN\r\n 8      Chandrila 150.0000   NaN\r\n 9   Concord Dawn 183.0000  79.0\r\n10       Corellia 175.0000  78.5\r\n# ... with 39 more rows\r\n\r\n# this does not\r\n\r\nhomeworld <- \"homeworld\"\r\n\r\nstarwars %>%\r\n  group_by(.data[[homeworld]]) %>%\r\n  summarise_at(vars(height:mass), mean, na.rm = TRUE)\r\n\r\nError in mutate_impl(.data, dots) : \r\n  Evaluation error: Must subset with a string.\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/tidyverse/dplyr/issues/comments/429541087","html_url":"https://github.com/tidyverse/dplyr/issues/2916#issuecomment-429541087","issue_url":"https://api.github.com/repos/tidyverse/dplyr/issues/2916","id":429541087,"node_id":"MDEyOklzc3VlQ29tbWVudDQyOTU0MTA4Nw==","user":{"login":"lionel-","id":4465050,"node_id":"MDQ6VXNlcjQ0NjUwNTA=","avatar_url":"https://avatars2.githubusercontent.com/u/4465050?v=4","gravatar_id":"","url":"https://api.github.com/users/lionel-","html_url":"https://github.com/lionel-","followers_url":"https://api.github.com/users/lionel-/followers","following_url":"https://api.github.com/users/lionel-/following{/other_user}","gists_url":"https://api.github.com/users/lionel-/gists{/gist_id}","starred_url":"https://api.github.com/users/lionel-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lionel-/subscriptions","organizations_url":"https://api.github.com/users/lionel-/orgs","repos_url":"https://api.github.com/users/lionel-/repos","events_url":"https://api.github.com/users/lionel-/events{/privacy}","received_events_url":"https://api.github.com/users/lionel-/received_events","type":"User","site_admin":false},"created_at":"2018-10-13T13:16:13Z","updated_at":"2018-10-13T13:16:13Z","author_association":"MEMBER","body":"This is fixed with rlang 0.3.0 (which will be on CRAN in 1 or 2 weeks) where `.data[[` is now an unquote operator. This way the subsetting variable is never masked by data."}}
{"actor":{"display_login":"lionel-"}}