{"action":"created","issue":{"url":"https://api.github.com/repos/hadley/tidyr/issues/176","repository_url":"https://api.github.com/repos/hadley/tidyr","labels_url":"https://api.github.com/repos/hadley/tidyr/issues/176/labels{/name}","comments_url":"https://api.github.com/repos/hadley/tidyr/issues/176/comments","events_url":"https://api.github.com/repos/hadley/tidyr/issues/176/events","html_url":"https://github.com/hadley/tidyr/pull/176","id":143286647,"number":176,"title":"Allow replace_na replacements to be given in the ... args","user":{"login":"dgrtwo","id":994718,"avatar_url":"https://avatars.githubusercontent.com/u/994718?v=3","gravatar_id":"","url":"https://api.github.com/users/dgrtwo","html_url":"https://github.com/dgrtwo","followers_url":"https://api.github.com/users/dgrtwo/followers","following_url":"https://api.github.com/users/dgrtwo/following{/other_user}","gists_url":"https://api.github.com/users/dgrtwo/gists{/gist_id}","starred_url":"https://api.github.com/users/dgrtwo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgrtwo/subscriptions","organizations_url":"https://api.github.com/users/dgrtwo/orgs","repos_url":"https://api.github.com/users/dgrtwo/repos","events_url":"https://api.github.com/users/dgrtwo/events{/privacy}","received_events_url":"https://api.github.com/users/dgrtwo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-24T16:01:17Z","updated_at":"2016-05-16T20:04:00Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hadley/tidyr/pulls/176","html_url":"https://github.com/hadley/tidyr/pull/176","diff_url":"https://github.com/hadley/tidyr/pull/176.diff","patch_url":"https://github.com/hadley/tidyr/pull/176.patch"},"body":"Allow replace_na replacements to be given as\r\n\r\n```r\r\nreplace_na(data, x = 0, y = \"unknown\")\r\n```\r\n\r\nalong with allowing the original behavior of\r\n\r\n```r\r\nreplace_na(data, list(x = 0, y = \"unknown\"))\r\n```\r\n\r\nAlso allows NSE evaluation to replace one NAs in one column with another column:\r\n\r\n```r\r\ndf <- data.frame(x = c(1, 2, NA), y = c(3, NA, 4))\r\nreplace_na(df, x = y)\r\n```\r\nIt's backwards compatible, ... wasn't being used. Includes additional test cases and examples."},"comment":{"url":"https://api.github.com/repos/hadley/tidyr/issues/comments/219531101","html_url":"https://github.com/hadley/tidyr/pull/176#issuecomment-219531101","issue_url":"https://api.github.com/repos/hadley/tidyr/issues/176","id":219531101,"user":{"login":"dgrtwo","id":994718,"avatar_url":"https://avatars.githubusercontent.com/u/994718?v=3","gravatar_id":"","url":"https://api.github.com/users/dgrtwo","html_url":"https://github.com/dgrtwo","followers_url":"https://api.github.com/users/dgrtwo/followers","following_url":"https://api.github.com/users/dgrtwo/following{/other_user}","gists_url":"https://api.github.com/users/dgrtwo/gists{/gist_id}","starred_url":"https://api.github.com/users/dgrtwo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgrtwo/subscriptions","organizations_url":"https://api.github.com/users/dgrtwo/orgs","repos_url":"https://api.github.com/users/dgrtwo/repos","events_url":"https://api.github.com/users/dgrtwo/events{/privacy}","received_events_url":"https://api.github.com/users/dgrtwo/received_events","type":"User","site_admin":false},"created_at":"2016-05-16T20:04:00Z","updated_at":"2016-05-16T20:04:00Z","body":"I hadn't seen coalesce and I certainly see how that replaces the need to refer to other columns; e.g. with `mutate(x = coalesce(x, y))` rather than `replace_na(x = y)`.\r\n\r\nAs for list vs `...`, I guess I'm not clear why the argument is a list in the first place. `replace(x = 0)` feels more natural (like a mutate) to me than `replace(list(x = 0))` and it's not missing any expressivity (Are there other similar dplyr/tidyr functions that take a list like this?). But I completely understand if the change is not worth either reverse incompatibility or the behavior of allowing both syntaxes."}}