Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement if_else #11

Closed
msberends opened this issue May 2, 2020 · 1 comment
Closed

Implement if_else #11

msberends opened this issue May 2, 2020 · 1 comment
Labels
feature request New feature or request

Comments

@msberends
Copy link
Contributor

msberends commented May 2, 2020

Function if_else() misses from your impressive list of rewritten functions 😄

To get started (still misses the missing = NULL argument of dplyr::if_else()):

if_else <- function(condition, true, false, ...) {
  if (!is.logical(condition)) {
    stop("`condition` must be a logical vector")
  }

  if (!identical(class(true), class(false))) {
    stop("Classes of `true` and `false` differ")
  }

  ifelse(condition, true, false)
}

Thank you so much, this is an awesome package to not rely on dplyr anymore, GREAT for package developers.

@nathaneastwood nathaneastwood added the feature request New feature or request label May 2, 2020
@nathaneastwood
Copy link
Owner

Very kind words 😄 thanks! I’ll take a look at adding this in the coming days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants