Skip to content

Commit

Permalink
fix cmd check
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleBeannie committed Nov 1, 2023
1 parent c871552 commit a438c93
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/get_analysis_date.R
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ get_analysis_date <- function(
# cutting option 5: minimal follow-up time after specified enrollment fraction
get_min_date <- function(enroll_rate, min_n = 400) {
if(!is.na(min_n)){
res <- stats::uniroot(f = function(x){expected_accrual(time = x, enroll_rate = enroll_rate) - min_n},
interval = c(0, sum(enroll_rate$duration)))
res <- stats::uniroot(f = function(x){gsDesign2::expected_accrual(time = x, enroll_rate = enroll_rate) - min_n},
interval = c(0, sum(enroll_rate$duration) + 1))
ans <- res$root
} else {
ans <- NA
Expand All @@ -257,7 +257,7 @@ get_analysis_date <- function(
if(!all(is.na(min_n_per_stratum))){
cut_date5b <- lapply(seq_along(min_n_per_stratum),
function(x){
get_min_date(enroll_rate %>% filter(stratum == stratum[x]), min_n = min_n_per_stratum[x])
get_min_date(enroll_rate %>% dplyr::filter(stratum == stratum[x]), min_n = min_n_per_stratum[x])
}) %>% unlist() %>% max(na.rm = TRUE) + min_followup
} else{
cut_date5b <- NA
Expand Down

0 comments on commit a438c93

Please sign in to comment.