library(clinfun)
ph2simon(pu = .2, pa = .4, ep1 = .05, ep2 = .1) # using 'Optimal'
# set.seed if needed
(ys = r_simon(R = 10L, n1 = 19L, n = 54L, r1 = 4L, prob = .3))
table(cut.default(ys, breaks = c(0, 4L, 15L, 54L), right = TRUE,
labels = c('early-termination', 'fail', 'success')))
Run the code above in your browser using DataLab