Skip to content

Commit

Permalink
Merge pull request #261 from Merck/move-h1
Browse files Browse the repository at this point in the history
Move function to internal
  • Loading branch information
LittleBeannie authored Jul 18, 2023
2 parents 05de3d1 + 4330455 commit 97f7525
Show file tree
Hide file tree
Showing 25 changed files with 144 additions and 339 deletions.
3 changes: 0 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export(expected_accrual)
export(expected_event)
export(expected_time)
export(fixed_design)
export(gridpts)
export(gs_b)
export(gs_create_arm)
export(gs_design_ahr)
Expand All @@ -33,8 +32,6 @@ export(gs_power_rd)
export(gs_power_wlr)
export(gs_spending_bound)
export(gs_spending_combo)
export(h1)
export(hupdate)
export(ppwe)
export(pw_info)
export(s2pwe)
Expand Down
6 changes: 3 additions & 3 deletions R/gridpts_h1_hupdate.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#' }
#' \if{html}{The contents of this section are shown in PDF user manual only.}
#'
#' @export
#' @noRd
#'
#' @examples
#' # Approximate variance of standard normal (i.e., 1)
Expand Down Expand Up @@ -93,7 +93,7 @@ gridpts <- function(r = 18, mu = 0, a = -Inf, b = Inf) {
#' }
#' \if{html}{The contents of this section are shown in PDF user manual only.}
#'
#' @export
#' @noRd
#'
#' @examples
#' # Replicate variance of 1, mean of 35
Expand Down Expand Up @@ -137,7 +137,7 @@ h1 <- function(r = 18, theta = 0, info = 1, a = -Inf, b = Inf) {
#' }
#' \if{html}{The contents of this section are shown in PDF user manual only.}
#'
#' @export
#' @noRd
#'
#' @examples
#' # 2nd analysis with no interim bound and drift 0 should have mean 0, variance 1
Expand Down
41 changes: 9 additions & 32 deletions R/gs_spending_bound.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,40 +80,17 @@
#' @importFrom gsDesign gsDesign sfLDOF
#' @importFrom stats qnorm
#'
#' @export
#'
#' @examples
#' info <- (1:3) * 10
#' info_frac <- info / max(info)
#' k <- length(info_frac)
#'
#' # 1st analysis
#' a1 <- gs_spending_bound(
#' k = 1, efficacy = FALSE, theta = 0,
#' par = list(sf = gsDesign::sfLDOF, total_spend = 0.025, timing = info_frac, param = NULL),
#' hgm1 = NULL
#' )
#'
#' b1 <- gs_spending_bound(
#' k = 1, efficacy = TRUE, theta = 0,
#' par = list(sf = gsDesign::sfLDOF, total_spend = 0.025, timing = info_frac, param = NULL),
#' hgm1 = NULL
#' gs_power_ahr(
#' analysis_time = c(12, 24, 36),
#' event = c(30, 40, 50),
#' binding = TRUE,
#' upper = gs_spending_bound,
#' upar = list(sf = gsDesign::sfLDOF, total_spend = 0.025, param = NULL, timing = NULL),
#' lower = gs_spending_bound,
#' lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.025, param = NULL, timing = NULL)
#' )
#' cat("The (lower, upper) boundary at the 1st analysis is (", a1, ", ", b1, ").\n")
#'
#' # 2nd analysis
#' a2 <- gs_spending_bound(
#' k = 2, efficacy = FALSE, theta = 0,
#' par = list(sf = gsDesign::sfLDOF, total_spend = 0.025, timing = info_frac, param = NULL),
#' hgm1 = h1(r = 18, theta = 0, info = info[1], a = a1, b = b1)
#' )
#'
#' b2 <- gs_spending_bound(
#' k = 2, efficacy = TRUE, theta = 0,
#' par = list(sf = gsDesign::sfLDOF, total_spend = 0.025, timing = info_frac, param = NULL),
#' hgm1 = h1(r = 18, theta = 0, info = info[1], a = a1, b = b1)
#' )
#' cat("The upper boundary at the 2nd analysis is (", a2, ", ", b2, ").\n")
#' @export
gs_spending_bound <- function(k = 1,
par = list(
sf = gsDesign::sfLDOF,
Expand Down
2 changes: 1 addition & 1 deletion R/utility_tidy_tbl.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ table_ab <- function(table_a, table_b, byvar, decimals = 1, aname = names(table_
# Get order of names to unite table_a columns together with names into a string
col_order <- c(rbind(names(anames), names(table_a)))
# Now unite columns of table_a into a string
astring <- xx %>% tidyr::unite("_alab", col_order, sep = " ")
astring <- xx %>% tidyr::unite("_alab", all_of(col_order), sep = " ")
# Bind this together with the byvar column
astring <- cbind(table_a %>% select(all_of(byvar)), astring)
# Now merge with table_b
Expand Down
3 changes: 0 additions & 3 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,6 @@ reference:
- expected_accrual
- ppwe
- s2pwe
- gridpts
- h1
- hupdate
- gs_create_arm
- pw_info

Expand Down
6 changes: 3 additions & 3 deletions inst/old_function/gridpts_h1_hupdate_oldR.R

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 10 additions & 11 deletions inst/old_function/gs_power_npe_.R

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 0 additions & 58 deletions man/gridpts.Rd

This file was deleted.

38 changes: 8 additions & 30 deletions man/gs_spending_bound.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 0 additions & 53 deletions man/h1.Rd

This file was deleted.

Loading

0 comments on commit 97f7525

Please sign in to comment.