TidierOrg / Tidier.jl

Meta-package for data analysis in Julia, modeled after the R tidyverse.
MIT License
515 stars 14 forks source link

Implement `janitor::clean_names()` #64

Closed kdpsingh closed 1 year ago

kdpsingh commented 1 year ago

This would be nice functionality to have. In R, this function cleans up column names in data frames, replacing spaces with underscores as well as a few other things.

Per https://cran.r-project.org/web/packages/janitor/vignettes/janitor.html#clean-dataframe-names-with-clean_names, here's what this function does:

werkstattcodes commented 1 year ago

fyi - Maybe not new, there is a julia package with basically the same intention. Could be helpful.

https://github.com/TheRoniOne/Cleaner.jl

kdpsingh commented 1 year ago

Ooh I wasn't aware! Thank you for sharing. Let me review and see if there's any value to wrapping or re-exporting this.

kdpsingh commented 1 year ago

Actually, this package looks like it does the job. I don't think there's a need for us to build this out. I'm going to add a Resources section in our documentation to point to other packages that people coming from R may find helpful. I'll add this one there and then will close the issue.

kdpsingh commented 1 year ago

Resolved by #68. Implemented the @clean_names macro that wraps Cleaner.jl’s polish_names() function. Unlike polish_names(), the @clean_names() macro expects the optional case argument to be a string rather than a symbol, always returns a data frame, and can handle grouped data frames, in which the result is a grouped data frame.