{"action":"created","issue":{"url":"https://api.github.com/repos/langcog/metalab/issues/97","repository_url":"https://api.github.com/repos/langcog/metalab","labels_url":"https://api.github.com/repos/langcog/metalab/issues/97/labels{/name}","comments_url":"https://api.github.com/repos/langcog/metalab/issues/97/comments","events_url":"https://api.github.com/repos/langcog/metalab/issues/97/events","html_url":"https://github.com/langcog/metalab/issues/97","id":165332454,"number":97,"title":"global.R crashes when creating \"subjects\"","user":{"login":"pagepiccinini","id":5055738,"avatar_url":"https://avatars.githubusercontent.com/u/5055738?v=3","gravatar_id":"","url":"https://api.github.com/users/pagepiccinini","html_url":"https://github.com/pagepiccinini","followers_url":"https://api.github.com/users/pagepiccinini/followers","following_url":"https://api.github.com/users/pagepiccinini/following{/other_user}","gists_url":"https://api.github.com/users/pagepiccinini/gists{/gist_id}","starred_url":"https://api.github.com/users/pagepiccinini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pagepiccinini/subscriptions","organizations_url":"https://api.github.com/users/pagepiccinini/orgs","repos_url":"https://api.github.com/users/pagepiccinini/repos","events_url":"https://api.github.com/users/pagepiccinini/events{/privacy}","received_events_url":"https://api.github.com/users/pagepiccinini/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/langcog/metalab/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-07-13T14:18:14Z","updated_at":"2016-07-13T15:28:22Z","closed_at":"2016-07-13T15:28:22Z","body":"The code\r\n\r\nsubjects <- all_data %>%\r\n  rowwise() %>%\r\n  mutate(n_total = sum(c(n_1, n_2), na.rm = TRUE)) %>%\r\n  distinct(dataset, study_ID, same_infant) %>%\r\n  group_by(dataset) %>%\r\n  summarise(num_subjects = sum(n_total))\r\n\r\ncrashes because the column \"n_total\" is removed by distinct(). Thus producing the error message(s):\r\nError: object 'n_total' not found\r\nIn addition: Warning message:\r\nGrouping rowwise data frame strips rowwise nature \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/langcog/metalab/issues/comments/232391865","html_url":"https://github.com/langcog/metalab/issues/97#issuecomment-232391865","issue_url":"https://api.github.com/repos/langcog/metalab/issues/97","id":232391865,"user":{"login":"pagepiccinini","id":5055738,"avatar_url":"https://avatars.githubusercontent.com/u/5055738?v=3","gravatar_id":"","url":"https://api.github.com/users/pagepiccinini","html_url":"https://github.com/pagepiccinini","followers_url":"https://api.github.com/users/pagepiccinini/followers","following_url":"https://api.github.com/users/pagepiccinini/following{/other_user}","gists_url":"https://api.github.com/users/pagepiccinini/gists{/gist_id}","starred_url":"https://api.github.com/users/pagepiccinini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pagepiccinini/subscriptions","organizations_url":"https://api.github.com/users/pagepiccinini/orgs","repos_url":"https://api.github.com/users/pagepiccinini/repos","events_url":"https://api.github.com/users/pagepiccinini/events{/privacy}","received_events_url":"https://api.github.com/users/pagepiccinini/received_events","type":"User","site_admin":false},"created_at":"2016-07-13T15:28:22Z","updated_at":"2016-07-13T15:28:22Z","body":"Agreed. Okay closing this then."}}
{"actor":{"display_login":"pagepiccinini"}}