Yeah coalesce() is more useful when you’ve got something like coalesce(new_metric, old_metric) where you have 2 variables that could hold valid information that you want to consolidate into one
Ah but this is not just for missing values. It's useful for replacing 1 or 2 values without having to retype all of them (what's useful for me is the default = y option, not necessarily the NA example)
Comments
cases_to_match <- c(
"GR" ~ "EL",
"CH" ~ "CN",
"SW" ~ "CH"
)
and then passed this to case_match(). It’s a matter of convenience.
𝘌𝘢𝘤𝘩 𝘤𝘢𝘴𝘦 𝘪𝘴 𝘦𝘷𝘢𝘭𝘶𝘢𝘵𝘦𝘥 𝘴𝘦𝘲𝘶𝘦𝘯𝘵𝘪𝘢𝘭𝘭𝘺 𝘢𝘯𝘥 𝘵𝘩𝘦 𝘧𝘪𝘳𝘴𝘵 𝘮𝘢𝘵𝘤𝘩 𝘧𝘰𝘳 𝘦𝘢𝘤𝘩 𝘦𝘭𝘦𝘮𝘦𝘯𝘵 𝘥𝘦𝘵𝘦𝘳𝘮𝘪𝘯𝘦𝘴 𝘵𝘩𝘦 𝘤𝘰𝘳𝘳𝘦𝘴𝘱𝘰𝘯𝘥𝘪𝘯𝘨 𝘷𝘢𝘭𝘶𝘦 𝘪𝘯 𝘵𝘩𝘦 𝘰𝘶𝘵𝘱𝘶𝘵 𝘷𝘦𝘤𝘵𝘰𝘳.
https://dplyr.tidyverse.org/reference/case_match.html
Let’s case_match more often, folks! ✊