-
Notifications
You must be signed in to change notification settings - Fork 8
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
Tweaking as_gt() #449
Merged
Merged
Tweaking as_gt() #449
Changes from 23 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
c65e170
use is.numeric() instead of is.vector(, 'numeric')
yihui aaccf68
use intersect() to find the class name to make the code terse
yihui 88d6650
remove curly braces (note that 'rd' appeared twice in switch() in the…
yihui 768edcc
merge the cases for 'mb', 'milestone', and 'rmst' in switch() by putt…
yihui 7e2e2e2
use attr() to retrieve a specific attribute instead of retrieving all…
yihui caa87e1
find the method by intersect(), similar to 691b5d4aa2908fe021018abd78…
yihui e08779c
use inherits() instead of testing class() directly
yihui cb4f64b
substr() and substring() are vectorized, so no need to lapply()
yihui d39e657
just merge the expressions since there are only two, and probably not…
yihui fd923a7
factor out `if (is.null(title | subtitle))`, and change `if (method)`…
yihui 9bf78b7
factor out the common elements in `display_columns` and add the only …
yihui ae7a8ce
the name 'display_columns' can appear 3 times instead of 6
yihui 747cdf3
`sum(!cond) >= 1` is equivalent to `!all(cond)` and the latter is muc…
yihui e6f357c
store the conditions in `i1` and `i2` so that we don't have to repeat…
yihui fbc081b
merge the two conditions by `&` in subset()
yihui 812c3f5
find the two names and substitute them via one operation
yihui 7863194
`if (!is.null(x)) if (length(x) != 0) for (i in seq_along(x))` is equ…
yihui 8e4bad5
factor out footnote_non_binding() so it can also be reused in as_rtf()
yihui 17fce05
delete 's' [ci skip]
yihui 2267998
use a string template instead
yihui 24113fd
get rid of optional quotes
yihui 7168d2d
bump version [ci skip]
yihui 90352a0
explicit return
yihui 2494e57
fix title for the 'rd' method
yihui 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Package: gsDesign2 | ||
Title: Group Sequential Design with Non-Constant Effect | ||
Version: 1.1.2.19 | ||
Version: 1.1.2.20 | ||
Authors@R: c( | ||
person("Keaven", "Anderson", email = "[email protected]", role = c("aut")), | ||
person("Yilong", "Zhang", email = "[email protected]", role = c("aut")), | ||
|
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.
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.
Hi Yihui, I have a question regarding the error message output. Typically, our practice in gsDesign2 is to print the function name at the beginning of the error message. This consideration arises from the possibility that the
ahr_blinded
function could potentially be invoked within another function. So... I am wondering if we should keep theahr_blinded
here?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.
Good question. I deleted the function name in the error message because I thought it would be redundant.
This relates to a comment I made after #448 (comment) That is, the function name will be missing if you
do.call
the function.I think this case is relatively rare (so far we have used
do.call()
mostly withrbind
/cbind
in this package). If it does happen,traceback()
can be helpful to know the chain of function calls.That said, again I don't have a strong opinion here. In general, my principle is that I'll follow the preference of the project maintainer (i.e. you in this case).
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.
Thank you for the clear explanation; I understand your intention. I am open to this. If we choose to remove the function name at the beginning of the error message, we should review the entire gsDesign2 package, as the previous practice of gsDesign2 is to include the function name right at the start (maybe a new issue and PR).
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.
Okay, as I'm going through the whole codebase, I'll do this along the way.
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, @yihui! This is not urgent and thanks again for reviewing the codes!
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 searched the repository for how
ahr_blinded()
is used. From the package code, examples, and tests,ahr_blinded()
is always called directly. In other words, the function itself is never passed as an argument to another function. Thus the fact that an error comes fromahr_blinded()
should be clear from the default error message, as @yihui noted above.To demonstrate, I added
stop("there was an error")
toahr_blinded()
and generated the error message below: