I'd like to apply a character replacement to all columns of a tibble. I can do it for one column:
starwars %>% mutate(name = str_replace_all(name, "-", ""))
But I do not understand how to generalise to with across()
:
starwars %>% mutate(
across(everything(),
str_replace_all("-", "")
)
)
Is it necessary to use the purr
package here?