{"action":"created","issue":{"url":"https://api.github.com/repos/hadley/lowliner/issues/30","labels_url":"https://api.github.com/repos/hadley/lowliner/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/hadley/lowliner/issues/30/comments","events_url":"https://api.github.com/repos/hadley/lowliner/issues/30/events","html_url":"https://github.com/hadley/lowliner/pull/30","id":53797652,"number":30,"title":"Let splat() specify default arguments for .f","user":{"login":"lionelgit","id":4465050,"avatar_url":"https://avatars.githubusercontent.com/u/4465050?v=3","gravatar_id":"","url":"https://api.github.com/users/lionelgit","html_url":"https://github.com/lionelgit","followers_url":"https://api.github.com/users/lionelgit/followers","following_url":"https://api.github.com/users/lionelgit/following{/other_user}","gists_url":"https://api.github.com/users/lionelgit/gists{/gist_id}","starred_url":"https://api.github.com/users/lionelgit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lionelgit/subscriptions","organizations_url":"https://api.github.com/users/lionelgit/orgs","repos_url":"https://api.github.com/users/lionelgit/repos","events_url":"https://api.github.com/users/lionelgit/events{/privacy}","received_events_url":"https://api.github.com/users/lionelgit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-01-08T20:34:56Z","updated_at":"2015-01-13T12:57:46Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hadley/lowliner/pulls/30","html_url":"https://github.com/hadley/lowliner/pull/30","diff_url":"https://github.com/hadley/lowliner/pull/30.diff","patch_url":"https://github.com/hadley/lowliner/pull/30.patch"},"body":"This lets `splat()` accept additional arguments that are fed to `.f` as defaults.\r\n\r\nWhen we pipe a list into a splatted function, it is often necessary to take care of additional arguments. That typically means adjusting the main list with additional arguments by using a temporary variable or `append()`ing  them in the middle of the pipe chain. Being able to specify these arguments directly in `splat()` hopefully leads to clearer code because the main arguments and the side arguments are specified separately (the former in the pipe chain and the latter in `splat()`)."},"comment":{"url":"https://api.github.com/repos/hadley/lowliner/issues/comments/69740274","html_url":"https://github.com/hadley/lowliner/pull/30#issuecomment-69740274","issue_url":"https://api.github.com/repos/hadley/lowliner/issues/30","id":69740274,"user":{"login":"lionelgit","id":4465050,"avatar_url":"https://avatars.githubusercontent.com/u/4465050?v=3","gravatar_id":"","url":"https://api.github.com/users/lionelgit","html_url":"https://github.com/lionelgit","followers_url":"https://api.github.com/users/lionelgit/followers","following_url":"https://api.github.com/users/lionelgit/following{/other_user}","gists_url":"https://api.github.com/users/lionelgit/gists{/gist_id}","starred_url":"https://api.github.com/users/lionelgit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lionelgit/subscriptions","organizations_url":"https://api.github.com/users/lionelgit/orgs","repos_url":"https://api.github.com/users/lionelgit/repos","events_url":"https://api.github.com/users/lionelgit/events{/privacy}","received_events_url":"https://api.github.com/users/lionelgit/received_events","type":"User","site_admin":false},"created_at":"2015-01-13T12:57:46Z","updated_at":"2015-01-13T12:57:46Z","body":"Not sure if we should use `enlist()` instead of `c()` in the `do.call()` calls.\r\n\r\nWith `enlist()`,\r\n```\r\nc(1:100, NA, 1000) %>% splat(mean)\r\n```\r\nwould work as expected.\r\n\r\nBut:\r\n```\r\nc(\"01\", \"01\", \"2001\") %>% splat(paste, sep = \"-\")\r\n## [1] \"01\"   \"01\"   \"2001\"\r\n```\r\n```\r\nlist(\"01\", \"01\", \"2001\") %>% splat(paste, sep = \"-\")\r\n## [1] \"01-01-2001\"\r\n```\r\nWith `c()` they would both work."}}