Skip to content
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 should support 'none' as a case option #269

Closed
andrewbarros opened this issue Feb 13, 2019 · 2 comments
Closed

clean_names should support 'none' as a case option #269

andrewbarros opened this issue Feb 13, 2019 · 2 comments

Comments

@andrewbarros
Copy link
Contributor

The documentation for clean_names states:

"parsed", "mixed", "none", "internal_parsing": less-common cases offered by snakecase::to_any_case. See to_any_case for details.

but the arguments in the function signature are
function (dat, case = c("snake", "lower_camel", "upper_camel", "screaming_snake", "lower_upper", "upper_lower", "all_caps", "small_camel", "big_camel", "old_janitor", "parsed", "mixed")) { case <- match.arg(case) ...
This makes calls with case = 'none' throw an error.

Reprex:

janitor::clean_names(mtcars, case = 'none')
#> Error in match.arg(case): 'arg' should be one of "snake", "lower_camel", "upper_camel", "screaming_snake", "lower_upper", "upper_lower", "all_caps", "small_camel", "big_camel", "old_janitor", "parsed", "mixed"

It's a rare case but I'd like to use the clean_names functionality for removing problematic characters but not touch the case.

I have a PR prepared if this is reasonable.

@sfirke
Copy link
Owner

sfirke commented Feb 13, 2019 via email

andrewbarros pushed a commit to andrewbarros/janitor that referenced this issue Feb 13, 2019
sfirke pushed a commit that referenced this issue Feb 14, 2019
…_parsing' case from docs (#270)

* Add 'none' and 'internal_parsing' as options for make_clean_names and make_names.

* Add 'none' and 'internal_parsing' as options for make_clean_names and make_names. Fixes #269

* - Remove documentation referencing 'internal_parsing'
- Remove internal_parsing from case options for make_clean_names and clean_names
@sfirke
Copy link
Owner

sfirke commented Feb 14, 2019

Thanks Andrew! Lucky commit 666 😈
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants