-
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
add creat_arm
by lose sum(accr_para) == 1
to is_wholenumber(sum(accr_para) - 1)
#345
add creat_arm
by lose sum(accr_para) == 1
to is_wholenumber(sum(accr_para) - 1)
#345
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.
I appreciate the idea but the best way is to contribute a patch to the upstream dependency and let the maintainer make a CRAN release.
Copying an entire function (implementation) with one thing changed instead of coding against the interface is problematic. This is because if the upstream dependency changes their internal implementations, those changes can easily break you package, as your modified copy is not updated.
The approach here will likely become technical debt and add extra burden to refactor.
Your code also loosened the original condition. The new logic only checked if the number is almost any integer: if (length(accr_interval) > 2 && !is_wholenumber(sum(accr_param) - 1)) but not checking if the number is almost is_almost_k <- function(x, k, tol = .Machine$double.eps^0.5) abs(x - k) < tol
if (length(accr_interval) > 2 && !is_almost_k(sum(accr_param), k = 1L)) |
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.
Following today's discussion, let's merge this so we have a working version for the short term, and create an issue #346 on reverting it back once npsurvSS is patched in the future.
Fixes #344