@@ -96,27 +96,22 @@ gs_info_ahr <- function(enroll_rate = define_enroll_rate(duration = c(2, 2, 10),
96
96
check_fail_rate(fail_rate )
97
97
check_enroll_rate_fail_rate(enroll_rate , fail_rate )
98
98
99
- # at least one of `analysis_time` or `event` should be provided
100
- if (is.null(analysis_time ) && is.null(event )) {
101
- stop(" gs_info_ahr(): One of `event` and `analysis_time`
102
- must be a numeric value or vector with increasing values" )
103
- }
104
-
105
- # get the number of analyses
106
- n_analysis <- 0
107
99
if (! is.null(analysis_time )) {
108
100
check_analysis_time(analysis_time )
109
- n_analysis <- length(analysis_time )
110
101
}
111
102
112
103
if (! is.null(event )) {
113
104
check_event(event )
114
- if (n_analysis == 0 ) {
115
- n_analysis <- length(event )
116
- } else if (n_analysis != length(event )) {
117
- stop(" gs_info_ahr(): If both event and analysis_time
118
- specified, must have same length" )
119
- }
105
+ }
106
+
107
+ # at least one of `analysis_time` or `event` should be provided
108
+ if (is.null(analysis_time ) && is.null(event )) {
109
+ stop(" gs_info_ahr(): One of `event` and `analysis_time`
110
+ must be a numeric value or vector with increasing values" )
111
+ }
112
+ # if both `analysis_time` and `event` are provided, check they are of same length
113
+ if (! is.null(analysis_time ) && ! is.null(event )) {
114
+ stop(" gs_info_ahr(): If both event and analysis_time specified, must have same length" )
120
115
}
121
116
122
117
# -------------------------- #
0 commit comments