{"action":"closed","issue":{"url":"https://api.github.com/repos/hadley/multidplyr/issues/5","labels_url":"https://api.github.com/repos/hadley/multidplyr/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/hadley/multidplyr/issues/5/comments","events_url":"https://api.github.com/repos/hadley/multidplyr/issues/5/events","html_url":"https://github.com/hadley/multidplyr/issues/5","id":116245807,"number":5,"title":"'Could not find function \"gam\"' in `group_by()` version of `models` in vignette","user":{"login":"jwpestrak","id":3246445,"avatar_url":"https://avatars.githubusercontent.com/u/3246445?v=3","gravatar_id":"","url":"https://api.github.com/users/jwpestrak","html_url":"https://github.com/jwpestrak","followers_url":"https://api.github.com/users/jwpestrak/followers","following_url":"https://api.github.com/users/jwpestrak/following{/other_user}","gists_url":"https://api.github.com/users/jwpestrak/gists{/gist_id}","starred_url":"https://api.github.com/users/jwpestrak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwpestrak/subscriptions","organizations_url":"https://api.github.com/users/jwpestrak/orgs","repos_url":"https://api.github.com/users/jwpestrak/repos","events_url":"https://api.github.com/users/jwpestrak/events{/privacy}","received_events_url":"https://api.github.com/users/jwpestrak/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-11T02:03:07Z","updated_at":"2015-11-11T12:11:28Z","closed_at":"2015-11-11T12:11:28Z","body":"I followed the vignette exactly (i.e., copy-and-paste) and ran into an issue towards the end:\r\n\r\n**Works**\r\n\r\n    system.time({\r\n        models <- by_dest %>% \r\n            do(mod = gam(dep_delay ~ s(yday) + s(dep_time), data = .))\r\n    })\r\n\r\n**Doesn't Work**\r\n\r\n    system.time({\r\n        models <- common_dest %>% \r\n            group_by(dest) %>% \r\n            do(mod = gam(dep_delay ~ s(yday) + s(dep_time), data = .))\r\n    })\r\n\r\nTraceback:\r\nError in eval(expr, envir, enclos) : could not find function \"gam\" \r\n14 eval(expr, envir, enclos) \r\n13 eval(args[[j]]$expr, envir = env) \r\n12 do_.grouped_df(.data, .dots = lazyeval::lazy_dots(...)) \r\n11 do_(.data, .dots = lazyeval::lazy_dots(...)) \r\n10 do(., mod = gam(dep_delay ~ s(yday) + s(dep_time), data = .)) \r\n9 function_list[[k]](value) \r\n8 withVisible(function_list[[k]](value)) \r\n7 freduce(value, `_function_list`) \r\n6 `_fseq`(`_lhs`) \r\n5 eval(expr, envir, enclos) \r\n4 eval(quote(`_fseq`(`_lhs`)), env, env) \r\n3 withVisible(eval(quote(`_fseq`(`_lhs`)), env, env)) \r\n2 common_dest %>% group_by(dest) %>% do(mod = gam(dep_delay ~ s(yday) + \r\n    s(dep_time), data = .)) \r\n1 system.time({\r\n    models <- common_dest %>% group_by(dest) %>% do(mod = gam(dep_delay ~ \r\n        s(yday) + s(dep_time), data = .))\r\n}) \r\n"}}