Skip to content

Commit

Permalink
Merge pull request #229 from Merck/foo-name
Browse files Browse the repository at this point in the history
rename foo (#228)
  • Loading branch information
nanxstats authored Jun 15, 2023
2 parents 1afba2e + 654d288 commit ac2e384
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions R/expected_time.R
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ expected_time <- function(enroll_rate = tibble::tibble(
# build a help function #
# ----------------------------#
# find the difference between `AHR()` and different values of total_duration
foo <- function(x) {
event_diff <- function(x) {
ans <- ahr(
enroll_rate = enroll_rate, fail_rate = fail_rate,
total_duration = x, ratio = ratio
Expand All @@ -121,7 +121,7 @@ expected_time <- function(enroll_rate = tibble::tibble(
# uniroot AHR() #
# over total_duration #
# ----------------------------#
res <- try(uniroot(foo, interval))
res <- try(uniroot(event_diff, interval))

if (inherits(res, "try-error")) {
stop("expected_time(): solution not found!")
Expand Down
4 changes: 2 additions & 2 deletions R/gs_design_combo.R
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ gs_design_combo <- function(enroll_rate = tibble(
}

# Function to calculate power
foo <- function(n, beta, ...) {
get_combo_power <- function(n, beta, ...) {
# Probability Cross Boundary
prob <- gs_prob_combo(
upper_bound = bound$upper,
Expand Down Expand Up @@ -227,7 +227,7 @@ gs_design_combo <- function(enroll_rate = tibble(
)


sample_size <- uniroot(foo, c(1, n_upper_bound), extendInt = "yes", beta = beta, ...)$root
sample_size <- uniroot(get_combo_power, c(1, n_upper_bound), extendInt = "yes", beta = beta, ...)$root
}

# Probability Cross Boundary
Expand Down

0 comments on commit ac2e384

Please sign in to comment.