Created
July 5, 2025 15:42
-
-
Save alejandrohagan/7e01e6e4bae4321c20315413e13690c6 to your computer and use it in GitHub Desktop.
replace_na() with new vs previous anonymous fucntion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## this works | |
cohorts::cohort_table_day(.data, id_var = customer_id, date = invoice_date) |> | |
dplyr::mutate( | |
dplyr::across(dplyr::everything(), ~tidyr::replace_na(., 0)) | |
) | |
## this doesn't work | |
cohorts::cohort_table_day(.data, id_var = customer_id, date = invoice_date) |> | |
dplyr::mutate( | |
dplyr::across(dplyr::everything(), \(x) tidyr::replace_na(., 0)) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment