-
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
Allow multiple rows input to row_to_names() #542
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you said it's not yet ready to merge, I converted it to a draft PR. I think you're on the right track, though tests make it easier to confirm. I'm about to make some code review comments.
R/row_to_names.R
Outdated
} | ||
if (row_number %in% "find_header") { | ||
if (any(row_number %in% "find_header")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be better as identical(row_number, "find_header")
because having some rows as numbers and one as "find_header"
would not be an input we would want to support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, it was changed.
Add documentation for `sep` argument Fine-tune check for using "find_header" argument Add input tests for `sep` argument Rewrite name manipulation more efficiently Handle NA column name to be "NA" Update `remove_rows_above` to refer to the topmost row Remove redundant function after using `paste_skip_na()`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty good to me. @sfirke, what do you think?
Codecov Report
@@ Coverage Diff @@
## main #542 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 26 26
Lines 1177 1182 +5
=========================================
+ Hits 1177 1182 +5
|
Merged. Thanks! |
This looks great! Sorry to miss the @ mention above. Thanks so much @matanhakim for contributing, @billdenney for review, and both for getting it to an excellent place 🙏 |
Thank you both for bringing this rich package to the community and facilitating my first PR feature contribution to FOSS in general and to the R community specifically🙏 |
And, @matanhakim, thanks for sticking with it to get the code into |
Description
This is mostly useful when it comes to data from Excel spreadsheets, where variable names are spread over multiple rows.
Please note that this is not yet a totally finished PR, as one test still fails and no new tests were built yet.
I would like to receive some feedback regarding this to understand if this is even the right direction, since this is my first PR contribution to an established package.
Changes are mostly around allowing multiple rows input and handling NA's and missing values.
Additionally, a test was removed and some code style changes were made for better readability.
Related Issue
Fixes #536.