-
Notifications
You must be signed in to change notification settings - Fork 993
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
Add total.label argument for groupingsets, cube, rollup #5973
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
7f51d08
Add 'label' argument
markseeto 96281c0
Add tests for groupingsets/cube/rollup 'label' argument
markseeto 78894ed
Add information for 'label' argument
markseeto 8af6585
Add item for groupingsets/cube/rollup 'label' argument
markseeto 32e6a64
Make changes following linter warnings
markseeto 9e8d3d4
avoid stop(paste0), use brackify()
MichaelChirico a11b4fa
update test for brackify()
MichaelChirico badb85d
lowercase 'r' in code gate hint
MichaelChirico 967f959
style on long if condition
MichaelChirico 0f676e9
Use .shallow() over a full copy
MichaelChirico 3ddc20b
save names(label) for reuse; more .shallow() usage
MichaelChirico 20a9eb0
simplify with mapply
MichaelChirico be03776
Build info with gettextf() for i18n
MichaelChirico 32c982b
short names
MichaelChirico 5aa23b9
More restricted scoping, building message with gettextf
MichaelChirico 4583d0d
consistency: name 'info'
MichaelChirico e582b5a
Merge branch 'master' into master
MichaelChirico File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
is this
!is.null(names(label))
check redundant? Since we haveis.list(label) && ... !is.null(names(label))
in the above requirement?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 do find it a bit surprising that the above check requires "a named list of scalars" but we have a separate test for "all list elements must be named", maybe best to add in the check for
""
/NA
names to the above condition?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.
We can address this as a small follow-up PR if you agree, don't want to hold the PR back further.
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.
Yes, I think you're right.
Maybe, but with separate checks the error messages can be more specific, the second one being for the situation where
label
is a named list but not all elements have a name. If we combine the error messages into one, it would be something like "Argument 'label', if not NULL, must be (1) a scalar, or (2) a named list with each element being named and each element being a scalar." Or "Argument 'label', if not NULL, must be (1) a scalar, or (2) a named list with no names being "" or NA and each element being a scalar." I think these are less clear and less helpful than having separate error messages depending on the situation. If you disagree, please let me know. It's not something I feel strongly about.