replace_first_match_col.Rd`replace_first_match_col()` replaces the name of the column in `first_match_col()` with what the user inputs
replace_first_match_col(x, pattern, how = c("all", "any"), replace_with)A dataframe
A pattern to match
How to match the pattern (all or any)
The name to replace the column name with
dataframe with the replaced column name
data <- data.frame(a = c("a", "b", "c"), b = c("a", " ", "c"), c = c("a", "b", "1"))
replace_first_match_col(data, "\\D", "all", "new")
#> new b c
#> 1 a a a
#> 2 b b
#> 3 c c 1
replace_first_match_col(data, "\\d", "any", "new")
#> a b new
#> 1 a a a
#> 2 b b
#> 3 c c 1