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

modify_if() methods are missing .else #786

Closed
DavisVaughan opened this issue Aug 10, 2020 · 1 comment
Closed

modify_if() methods are missing .else #786

DavisVaughan opened this issue Aug 10, 2020 · 1 comment
Labels
bug an unexpected problem or unintended behavior modify 🛠️

Comments

@DavisVaughan
Copy link
Member

The generic and default method have .else

purrr/R/modify.R

Lines 215 to 237 in 5de5ad2

modify_if.integer <- function(.x, .p, .f, ...) {
sel <- probe(.x, .p)
.x[sel] <- map_int(.x[sel], .f, ...)
.x
}
#' @export
modify_if.double <- function(.x, .p, .f, ...) {
sel <- probe(.x, .p)
.x[sel] <- map_dbl(.x[sel], .f, ...)
.x
}
#' @export
modify_if.character <- function(.x, .p, .f, ...) {
sel <- probe(.x, .p)
.x[sel] <- map_chr(.x[sel], .f, ...)
.x
}
#' @export
modify_if.logical <- function(.x, .p, .f, ...) {
sel <- probe(.x, .p)
.x[sel] <- map_lgl(.x[sel], .f, ...)
.x
}

@DavisVaughan DavisVaughan added the bug an unexpected problem or unintended behavior label Aug 10, 2020
@hadley
Copy link
Member

hadley commented Aug 24, 2022

Duplicate of #701

@hadley hadley marked this as a duplicate of #701 Aug 24, 2022
@hadley hadley closed this as completed Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior modify 🛠️
Projects
None yet
Development

No branches or pull requests

2 participants