-
Notifications
You must be signed in to change notification settings - Fork 11
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
Review wb_dims()
#702
Review wb_dims()
#702
Conversation
* Separate from the other `dims_helpers` as they may become redundant when `wb_dims()` works well. * `col2int()` may not need to be advertised after all. * Prepare tests, but `skip_on_ci()` for now to keep passing checks.
…orted Make `col2int()` return an integer instead of a numeric.
* I now make `wb_dims()` complain when row is not an integer. (doesn't really make sense to specify "A") when it's only for columns in Excel.
Thanks for the pull request. I'll review it later this week. Its already past midnight and it's a bit to complicated for my sleepy head. |
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 like the general direction of the pull request and have made a few comments. We might want to think about start_
arguments and what they are supposed to do.
as mentioned in one of the commentd, I see them as |
(With rlang, they could be displayed once per session.)
Add examples that my `wb_dims()` can do to improve a openxlsx2 workflow
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.
Here are the parts I think are more important. Sorry about the hard to read code in some places..
Maybe another wrapper be even clearer?
I had issues dealing with add_data(col_names = FALSE)
, so I warn if x
has column names, but specify col_names = FALSE
Edit: thanks a lot for the review!
Edit 2: Feel free to close too. It`s more complicated than I wished it to be. I like the result, and think it can streamline styling and formatting, but I may be wrong ;)
Edit 3: maybe ask for another review to see if they think this can be useful?
Thanks for the PR and thanks for being open minded! I'll try to review the PR tomorrow or Sunday. I have spent way to much time these last two weeks on Regarding Edit 2 and the increased complexity: after all, I might have stated this already elsewhere, |
Nice example. Still, I don't like changing col_names from our default value for wb_dims(). You may drop it if x and cols are selected or can add some additional selection function. Something like "top, left, right, bottom, data" if you want to pick something explicitly. But picking the data part without the columns per default is somewhat counter intuitive. |
I have thought of a new and simpler implementation. I should push tomorrow. Instead of relying on rows = 0 , I added an argument select = "col_names" |
HI @JanMarvin, this is ready for review!
this approach gets rid of the Ideally, it would be great to start a new PR with a clean state, but I don't know how to do that...) EDIT: thanks a lot for your patience. It was a lot of tries, but I think it feels more right now, after the iterations! |
Merge commit '2a7412ff490ede7bc56e25814b9485e0131432a4'
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.
Thanks, my only regret is that this wb_dims()
function is growing bigger and bigger. I didn't want to compete with cellranger
.
Minor comments, otherwise if should be fine.
Thanks. Let me know what you think about the |
I put it as error, can always change behavior should need arise! but imo, it's better to be explicit! I think that wb_dims() could make code easier to read, but using it withoutarguments is just mysterious. no need for that ;) it is easy to type wb_dims(1, 1) |
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.
remove outdated example
|
I'll squash merge once the CI is green. Thank you for sticking to it and for the PR! Hope you had at least a tiny bit of fun and maybe learned a bit or two about |
Tjanks for letting me! Hopefully, it can help users! It will help me ar least |
Aims to fix #697 , follow up to #691
This PR aims to enable the following syntax
EDIT: Updated example to reflect latest API when using
wb_dims()
withx
.