Overview of the bug:
The following codes gives the error message "Error: accr_param must sum to 1."
gs_power_wlr(enroll_rate = define_enroll_rate(duration = c(1, 1, 6), rate = c(2, 10.8, 30.2)))
Although the input sample size sum(c(1, 1, 6) * c(2, 10.8, 30.2)) = 194 is an integer, it still reports an error on the accrual parameters.
Debug finding:
By debuging, it looks the problem lies in npsurvSS::create_arm(). It has a strict check of the accrual parameters, i.e., sum(accr_param) == 1. Where accr_param = enroll_rate$rate * enroll_rate$duration / sum(enroll_rate$rate * enroll_rate$duration). It is possible that sum(accr_param) might be some number very CLOSE to 1, but not exactly 1, say, 1.0000001. If it happens, it will give an error message.

Proposed solution:
Option 1: send a PR to npsurvSS and ask Godwin to do a new CRAN release (stable but may take long time to wait for the CRAN release)
Option 2: Build an internal gsDesign2:::creat_arm() function and lose the check of sum(accr_para) == 1 to gsDesign2:::is_wholenumber() (not stable but fast)
Overview of the bug:
The following codes gives the error message "Error: accr_param must sum to 1."
Although the input sample size
sum(c(1, 1, 6) * c(2, 10.8, 30.2)) = 194is an integer, it still reports an error on the accrual parameters.Debug finding:
By debuging, it looks the problem lies in

npsurvSS::create_arm(). It has a strict check of the accrual parameters, i.e.,sum(accr_param) == 1. Whereaccr_param=enroll_rate$rate * enroll_rate$duration / sum(enroll_rate$rate * enroll_rate$duration). It is possible thatsum(accr_param)might be some number very CLOSE to 1, but not exactly 1, say, 1.0000001. If it happens, it will give an error message.Proposed solution:
Option 1: send a PR to npsurvSS and ask Godwin to do a new CRAN release (stable but may take long time to wait for the CRAN release)
Option 2: Build an internal
gsDesign2:::creat_arm()function and lose the check ofsum(accr_para) == 1togsDesign2:::is_wholenumber()(not stable but fast)