Skip to content

Commit fcbab55

Browse files
committed
unwrap examples
1 parent 4aaea0d commit fcbab55

30 files changed

Lines changed: 186 additions & 266 deletions

CRAN-SUBMISSION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Version: 1.0.1
2-
Date: 2025-09-11 15:23:20 UTC
3-
SHA: a294880155d61ecbee1fc22f127ed598f99ba9e3
1+
Version: 1.0.2
2+
Date: 2025-09-16 11:37:13 UTC
3+
SHA: 4aaea0d89839c008e43b4736b713c1f19204119e

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: BOP2FE
22
Type: Package
33
Title: Bayesian Optimal Phase II Design with Futility and Efficacy Stopping Boundaries
4-
Version: 1.0.2
4+
Version: 1.0.3
55
Authors@R: c(
66
person("Belay Birlie", "Yimer", email = "belayabyimer@gmail.com", role = c("aut", "cre")),
77
person("Xinling", "Xu", role = "aut"),

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# BOP2FE 1.0.3
2+
13
# BOP2FE 1.0.2
24

35
# BOP2FE 1.0.1

R/binary_endpoint.R

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@
2424
#'
2525
#' @returns A list with the first element corresponding to futility and the second for efficacy boundaries
2626
#' @examples
27-
#'\donttest{
2827
#' H0 <- 0.2
2928
#' a1 <- H0
3029
#' b1 <- 1- a1
3130
#' seed <- 123
32-
#' n <- c(10, 5, 5, 5, 5, 5, 5)
31+
#' n <- c(10, 5, 5)
3332
#' method <- "power"
3433
#'
3534
#' boundary_binary<- get_boundary_binary(H0=H0, a1=a1, b1=b1, n =n,
@@ -38,7 +37,6 @@
3837
#' eta = seq(0, 3, l = 301),
3938
#' method = method,
4039
#' seed = seed)
41-
#' }
4240
#'
4341
get_boundary_binary <- function(H0, a1, b1, n, lambda, gamma, eta = NULL, method = "power", seed=NULL) {
4442
set.seed(seed)
@@ -180,12 +178,11 @@ get_boundary_binary <- function(H0, a1, b1, n, lambda, gamma, eta = NULL, method
180178
#' }
181179
#'
182180
#' @examples
183-
#' \donttest{
184181
#' H0 <- 0.2
185182
#' a1 <- H0
186183
#' b1 <- 1-a1
187184
#' seed <- 123
188-
#' n <- c(10, 5, 5, 5, 5, 5, 5)
185+
#' n <- c(10, 5, 5)
189186
#' method <- "power"
190187
#' boundary_tab<- get_boundary_binary(H0=H0, a1=a1, b1=b1, n =n,
191188
#' lambda = seq(0, 1, l = 11),
@@ -195,13 +192,12 @@ get_boundary_binary <- function(H0, a1, b1, n, lambda, gamma, eta = NULL, method
195192
#' seed=seed)
196193
#' test_oc<-get_oc_binary(
197194
#' p = 0.2,
198-
#' n = c(10, 5, 5, 5, 5, 5, 5),
195+
#' n = c(10, 5, 5),
199196
#' nsim = 1000,
200197
#' fb = boundary_tab$cnf,
201198
#' sb = boundary_tab$cns,
202199
#' seed = seed
203200
#' )
204-
#' }
205201
#'
206202
get_oc_binary <- function(p, n, nsim, fb, sb, seed = NULL) {
207203
set.seed(seed)
@@ -374,19 +370,17 @@ get_oc_binary <- function(p, n, nsim, fb, sb, seed = NULL) {
374370
#' \item{gamma: }{gamma values for cut-off probability}
375371
#' \item{eta: }{eta values for cut-off probability}}
376372
#' @examples
377-
#' \donttest{
378373
#' oc_binary<-get_boundary_oc_binary(
379374
#' H0=0.2,
380375
#' H1= 0.4,
381-
#' n = c(10, 5, 5, 5, 5, 5, 5),
376+
#' n = c(10, 5, 5),
382377
#' nsim = 1000,
383378
#' lambda = seq(0, 1, l = 11),
384379
#' gamma = seq(0, 1, l = 11),
385380
#' eta = seq(0, 3, l = 31),
386381
#' method = "power",
387382
#' seed = 1
388383
#' )
389-
#' }
390384
#'
391385
get_boundary_oc_binary <- function(
392386
H0, H1, n, nsim, lambda, gamma, eta = NULL, method = "power", seed = NULL
@@ -492,11 +486,10 @@ get_boundary_oc_binary <- function(
492486
#' @export
493487
#' @keywords internal
494488
#' @examples
495-
#' \donttest{
496489
#'test_binary <- search_optimal_pars_binary(
497490
#' H0=0.2,
498491
#' H1= 0.4,
499-
#' n = c(10, 5, 5, 5, 5, 5, 5),
492+
#' n = c(10, 5, 5),
500493
#' nsim = 1000,
501494
#' t1e = 0.1,
502495
#' method = "power",
@@ -511,7 +504,6 @@ get_boundary_oc_binary <- function(
511504
#' grid3 = 31,
512505
#' seed = 123
513506
#')
514-
#'}
515507
#'
516508
#'
517509
search_optimal_pars_binary <- function(

R/coprimary_endpoint.R

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,16 @@
2222
#'
2323
#' @returns A list with the first element corresponding to futility and the second for efficacy boundaries
2424
#' @examples
25-
#' \donttest{
2625
#' H0=c(0.05,0.05, 0.15, 0.75)
2726
#' a <- H0
2827
#' seed <- 123
29-
#' n <- c(10, 5, 5, 5, 5, 5, 5)
28+
#' n <- c(10, 5, 5)
3029
#' method <- "power"
3130
#' test1<- get_boundary_coprimary(H0=H0, a=a, n =n,
3231
#' lambda = seq(0, 1, l = 11),
3332
#' gamma = seq(0, 1, l = 11),
3433
#' eta = seq(0, 3, l = 31),
3534
#' method = "power")
36-
#' }
3735
#'
3836
get_boundary_coprimary <- function(H0, a, n, lambda, gamma, eta = NULL, method = "power", seed = NULL) {
3937
set.seed(seed)
@@ -273,11 +271,10 @@ get_boundary_coprimary <- function(H0, a, n, lambda, gamma, eta = NULL, method =
273271
#' }
274272
#'
275273
#' @examples
276-
#' \donttest{
277274
#' H0=c(0.05,0.05, 0.15, 0.75)
278275
#' a <- H0
279276
#' seed <- 123
280-
#' n <- c(10, 5, 5, 5, 5, 5, 5)
277+
#' n <- c(10, 5, 5)
281278
#' method <- "power"
282279
#' boundary_tab<- get_boundary_coprimary(H0=H0, a=a, n =n,
283280
#' lambda = seq(0, 1, l = 11),
@@ -290,13 +287,12 @@ get_boundary_coprimary <- function(H0, a, n, lambda, gamma, eta = NULL, method =
290287
#' p2 = 0.05,
291288
#' p3 = 0.15,
292289
#' p4 = 0.75,
293-
#' n = c(10, 5, 5, 5, 5, 5, 5),
290+
#' n = c(10, 5, 5),
294291
#' nsim = 1000,
295292
#' fb = boundary_tab$cnf,
296293
#' sb = boundary_tab$cns,
297294
#' seed = seed
298295
#' )
299-
#' }
300296
#'
301297
get_oc_coprimary <- function(p1, p2, p3, p4, n, nsim, fb, sb, seed = NULL) {
302298
set.seed(seed)
@@ -516,19 +512,18 @@ get_oc_coprimary <- function(p1, p2, p3, p4, n, nsim, fb, sb, seed = NULL) {
516512
#' \item{gamma: }{gamma values for cut-off probability}
517513
#' \item{eta: }{eta values for cut-off probability}}
518514
#' @examples
519-
#' \donttest{
520515
#' oc_coprimary<-get_boundary_oc_coprimary(
521516
#' H0=c(0.15,0.30, 0.15, 0.40),
522517
#' H1= c(0.18,0.42, 0.02, 0.38),
523-
#' n = c(10, 5, 5, 5, 5, 5, 5),
518+
#' n = c(10, 5, 5),
524519
#' nsim = 1000,
525520
#' lambda = seq(0, 1, l = 11),
526521
#' gamma = seq(0, 1, l = 11),
527522
#' eta = seq(0, 3, l = 31),
528523
#' method = "power",
529524
#' seed = 1
530525
#' )
531-
#' }
526+
532527
#'
533528
get_boundary_oc_coprimary <- function(
534529
H0, H1, n, nsim, lambda, gamma, eta = NULL, method = "power", seed = NULL
@@ -642,11 +637,10 @@ get_boundary_oc_coprimary <- function(
642637
#' @export
643638
#' @keywords internal
644639
#' @examples
645-
#' \donttest{
646640
#'test_comprimary <- search_optimal_pars_coprimary(
647641
#' H0=c(0.05,0.05, 0.15, 0.75),
648642
#' H1= c(0.15,0.15, 0.20, 0.50),
649-
#' n = c(10, 5, 5, 5, 5, 5, 5),
643+
#' n = c(10, 5, 5),
650644
#' nsim = 1000,
651645
#' t1e = 0.1,
652646
#' method = "power",
@@ -661,7 +655,6 @@ get_boundary_oc_coprimary <- function(
661655
#' grid3 = 31,
662656
#' seed = 123
663657
#')
664-
#'}
665658
#'
666659
search_optimal_pars_coprimary <- function(
667660
H0, H1, n, nsim, t1e = NULL, method = "power",

R/efftox_endpoint.R

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,16 @@
2222
#'
2323
#' @returns A list with the first element corresponding to futility and the second for efficacy boundaries
2424
#' @examples
25-
#' \donttest{
2625
#' H0=c(0.15,0.30, 0.15, 0.40)
2726
#' a <- H0
2827
#' seed <- 123
29-
#' n <- c(10, 5, 5, 5, 5, 5, 5)
28+
#' n <- c(10, 5, 5)
3029
#' method <- "power"
3130
#' test1<- get_boundary_jointefftox(H0=H0, a=a, n =n,
3231
#' lambda = seq(0, 1, l = 11),
3332
#' gamma = seq(0, 1, l = 11),
3433
#' eta = seq(0, 3, l = 31),
3534
#' method = "power")
36-
#' }
3735
#'
3836

3937
get_boundary_jointefftox <- function(H0, a, n, lambda, gamma, eta = NULL, method = "power", seed = NULL) {
@@ -279,11 +277,10 @@ get_boundary_jointefftox <- function(H0, a, n, lambda, gamma, eta = NULL, method
279277
#' }
280278
#'
281279
#' @examples
282-
#' \donttest{
283280
#' H0=c(0.15,0.30, 0.15, 0.40)
284281
#' a <- H0
285282
#' seed <- 123
286-
#' n <- c(10, 5, 5, 5, 5, 5, 5)
283+
#' n <- c(10, 5, 5)
287284
#' method <- "power"
288285
#' boundary_tab<- get_boundary_jointefftox(H0=H0, a=a, n =n,
289286
#' lambda = seq(0, 1, l = 11),
@@ -296,13 +293,12 @@ get_boundary_jointefftox <- function(H0, a, n, lambda, gamma, eta = NULL, method
296293
#' p2 = 0.30,
297294
#' p3 = 0.15,
298295
#' p4 = 0.40,
299-
#' n = c(10, 5, 5, 5, 5, 5, 5),
296+
#' n = c(10, 5, 5),
300297
#' nsim = 1000,
301298
#' fb = boundary_tab$cnf,
302299
#' sb = boundary_tab$cns,
303300
#' seed = seed
304301
#' )
305-
#' }
306302
#'
307303
get_oc_jointefftox <- function(p1, p2, p3, p4, n, nsim, fb, sb, seed = NULL) {
308304
set.seed(seed)
@@ -561,19 +557,17 @@ get_oc_jointefftox <- function(p1, p2, p3, p4, n, nsim, fb, sb, seed = NULL) {
561557
#' \item{gamma: }{gamma values for cut-off probability}
562558
#' \item{eta: }{eta values for cut-off probability}}
563559
#' @examples
564-
#' \donttest{
565560
#' oc_joint<-get_boundary_oc_efftox(
566561
#' H0=c(0.15,0.30, 0.15, 0.40),
567562
#' H1= c(0.18,0.42, 0.02, 0.38),
568-
#' n = c(10, 5, 5, 5, 5, 5, 5),
563+
#' n = c(10, 5, 5),
569564
#' nsim = 1000,
570565
#' lambda = seq(0, 1, l = 11),
571566
#' gamma = seq(0, 1, l = 11),
572567
#' eta = seq(0, 3, l = 31),
573568
#' method = "power",
574569
#' seed = 1
575570
#' )
576-
#' }
577571
#'
578572
get_boundary_oc_efftox <- function(
579573
H0, H1, n, nsim, lambda, gamma, eta = NULL, method = "power", seed = NULL
@@ -687,11 +681,10 @@ get_boundary_oc_efftox <- function(
687681
#' @export
688682
#' @keywords internal
689683
#' @examples
690-
#' \donttest{
691-
#'test_jointy <- search_optimal_pars_efftox(
684+
#'test_joint <- search_optimal_pars_efftox(
692685
#' H0=c(0.15,0.30, 0.15, 0.40),
693686
#' H1= c(0.18,0.42, 0.02, 0.38),
694-
#' n = c(10, 5, 5, 5, 5, 5, 5),
687+
#' n = c(10, 5, 5),
695688
#' nsim = 1000,
696689
#' t1e = 0.1,
697690
#' method = "power",
@@ -706,7 +699,6 @@ get_boundary_oc_efftox <- function(
706699
#' grid3 = 31,
707700
#' seed = 123
708701
#')
709-
#'}
710702
#'
711703
search_optimal_pars_efftox <- function(
712704
H0, H1, n, nsim, t1e = NULL, method = "power",

0 commit comments

Comments
 (0)