Skip to content

Commit

Permalink
check the differences among different OSes for the problem in Merck/s…
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Aug 8, 2024
1 parent a28b9db commit 4c06480
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/debug.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ jobs:
strategy:
matrix:
config:
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release', http-user-agent: 'release'}
- {os: macOS-latest, r: 'release', http-user-agent: 'release'}
- {os: windows-latest, r: 'release', http-user-agent: 'release'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -30,5 +32,5 @@ jobs:
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- name: Setup tmate session
uses: mxschmitt/action-tmate@HEAD
- run: |
Rscript n.R
38 changes: 38 additions & 0 deletions n.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
install.packages('gsDesign2')

ratio <- 1

enroll_rate <- gsDesign2::define_enroll_rate(duration = c(2, 2, 8),
rate = c(1, 2, 3))

fail_rate <- gsDesign2::define_fail_rate(duration = c(4, Inf),
fail_rate = log(2) / 12,
hr = c(1, .6),
dropout_rate = .001)

alpha <- 0.025
beta <- 0.1

upper <- gsDesign2::gs_spending_bound
upar <- list(sf = gsDesign::sfLDOF, total_spend = alpha)
test_upper <- rep(TRUE, 2)

lower <- gsDesign2::gs_spending_bound
lpar <- list(sf = gsDesign::sfLDOF, total_spend = beta)
test_lower <- c(TRUE, FALSE)
binding <- FALSE

info_frac = NULL
analysis_time = c(24, 36)

x <- gsDesign2::gs_design_ahr(enroll_rate = enroll_rate, fail_rate = fail_rate,
alpha = alpha, beta = beta, ratio = ratio,
info_frac = info_frac, analysis_time = analysis_time,
upper = upper, upar = upar, test_upper = test_upper,
lower = lower, lpar = lpar, test_lower = test_lower,
binding = binding)

n <- x$analysis$n
n - round(n)
as.integer(n)
length(sample('All', n[2], TRUE))

0 comments on commit 4c06480

Please sign in to comment.