-
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
provide wb_dims() #691
provide wb_dims() #691
Conversation
|
Oh yes, I like that, especially with the prefix! With this, there wouldn't be a use-case for rowcol_to_dims() in the exported API? could inform users of the new syntax. But I think it's another step forward for a consistent, streamlined API |
Yes, this would be a more convenient and possibly simpler to remember function that creates the same output. It's a wrapper around functions. |
Hi @JanMarvin , after reviewing,
wb_dims(mtcars)
"A1:K33"
# I propose:
wb_dims(mtcars, data_only = TRUE)
"A2:K33"
# it could be very useful when applying styling to the data.
# Edit2
wb_dims(mtcars, col_names = FALSE)
"A1:K32"
# you have to add
wb_dims(mtcars, col_names = FALSE, start_row = 2)
"A2:K33"
# to give the correct result. Which one do you think is correct?
# it would be good if this worked too
wb_dims(mtcars, cols = 4)
# but you have to specify to make it work.
wb_dims( cols = 4, rows = seq_len(nrow(mtcars))
# now
wb_dims(cols = 4)
"A1"
# I suggest
wb_dims(cols = 4)
"D1" I can file a new issue if it's easier. Edit: I think that all arguments in so this should fail wb_dims(mtcars) should be replaced by wb_dims(x = mtcars) # or data = Also a personal wish (as I would love to think about the Excel result as little as possible. Could something like this work? wb_dims(x = mtcars, cols = "vs")
|
like But yes, I though about the same (regarding columns, rownames and data selection). Go for it if you want to improve it. I usually use the cell directly. Open a new issue or a pull request, I currently don't have time for this. |
@olivroy something I quickly typed down in addition to #681, thinking about
ggplot2::aes()
and how clean this approach is. This PR provideswb_dims()
which can take eitherrow
/col
,rows/cols
or objects that can be coerced viaas.data.frame()
.This could be tweaked further, but might provide a simpler helper for users. A name to indicate that it is coming fromopenxlsx
could bewb_dims()
.Please let me know what you think!
[Edit:] Updated