-
Notifications
You must be signed in to change notification settings - Fork 130
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
clean_names: support abbreviations argument of snakecase::to_any_case
?
#283
Comments
@billdenney what do you think, while we are at it with |
Yes, with #340, all options to |
Thank you both. Reprex below showing the new functionality in case it's useful to anyone: library(magrittr)
# ID is converted to Id
tibble::tibble("person ID" = c(1)) %>%
janitor::clean_names("upper_camel")
#> # A tibble: 1 x 1
#> PersonId
#> <dbl>
#> 1 1
# we can now pass the abbreviations argument along to snakecase::to_any_case
tibble::tibble("person ID" = c(1)) %>%
janitor::clean_names("upper_camel", abbreviations = "ID")
#> # A tibble: 1 x 1
#> PersonID
#> <dbl>
#> 1 1 Created on 2020-03-12 by the reprex package (v0.3.0) |
Could
clean_names
support passing anabbreviations
argument to theabbreviations
argument ofsnakecase::to_any_case
?My use case for this would be to keep certain abbreviations e.g. "ID" capitalised when using
clean_names
to convert column names to UpperCamel.Created on 2019-04-02 by the reprex package (v0.2.1)
Session info
The text was updated successfully, but these errors were encountered: