Running examples in ‘ph2bye-Ex.R’ failed
The error most likely occurred in:

> ### Name: bayes.design
> ### Title: Bayesian design method for sequentially monitoring patients
> ###   using Beta-Binomial posterior probability based on observing data
> ### Aliases: bayes.design
> 
> ### ** Examples
> 
> # Using Multiple Myeloma (MM) data example
> MM.r = rep(0,6); MM.mean = 0.1; MM.var = 0.0225
> a <- MM.mean^2*(1-MM.mean)/MM.var - MM.mean; b <- MM.mean*(1-MM.mean)^2/MM.var - (1-MM.mean)
> bayes.design(a=a,b=b,r=MM.r,stop.rule="futility",p0=0.1)
$para.a
[1] 0.3

$para.b
[1] 2.7

$`poterior mean`
[1] 0.0750 0.0600 0.0500 0.0429 0.0375 0.0333

Warning in min(which(pbeta(p0, a + r, b + n - r) > tau2)) :
  no non-missing arguments to min; returning Inf
[1] "Stop the trial for futility after the inclusion of Inf patients."

 *** caught segfault ***
address 0, cause 'memory not mapped'

Traceback:
 1: magick_image_write(image, format, quality, depth, density, comment)
 2: magick::image_write(anim, path = output)
 3: magick.convert(files = files, output = output, loop = loop, interval = interval,     dispose = dispose)
 4: im.convert(img.files, output = path.expand(movie.name), convert = convert,     cmd.fun = cmd.fun, clean = clean, extra.opts = extra.opts)
 5: animation::saveGIF({    if (stop.rule == "efficacy") {        n1 <- min(which(pbeta(p0 + delta, a + r, b + n - r, lower.tail = F) >             tau1))        print(paste("Stop the trial for efficacy after the inclusion of",             n1, "patients."))        for (i in seq_along(n)) {            graphics::plot(n[1:i], pbeta(p0 + delta, a + r[1:i],                 b + n[1:i] - r[1:i], lower.tail = F), xlim = c(1,                 length(r)), ylim = c(0, 1), type = "o", xlab = "Number of patients",                 ylab = "Posterior Probability")            graphics::abline(h = tau1, lty = 2)            graphics::legend("bottomright", c("Posterior tial prob",                 "Stopping threshold"), lty = c(1, 2), cex = 0.8)        }        graphics::abline(v = n1, lwd = 5, col = "red")        cdf <- VGAM::pbetabinom.ab(q = c(0:add.size), size = add.size,             shape1 = a + max(r), shape2 = b + max(n) - max(r))        graphics::plot(c(0:add.size), cdf, type = "S")    }    else if (stop.rule == "futility") {        n2 <- min(which(pbeta(p0, a + r, b + n - r) > tau2))        print(paste("Stop the trial for futility after the inclusion of",             n2, "patients."))        for (i in seq_along(n)) {            graphics::plot(n[1:i], pbeta(p0, a + r[1:i], b +                 n[1:i] - r[1:i]), xlim = c(1, length(r)), ylim = c(0,                 1), type = "o", xlab = "Number of patients",                 ylab = "Posterior Probability")            graphics::abline(h = tau2, lty = 2)            graphics::legend("bottomright", c("Posterior tial probability",                 "Stopping threshold"), lty = c(1, 2), cex = 0.8)        }        graphics::abline(v = n2, lwd = 5, col = "red")        cdf <- VGAM::pbetabinom.ab(q = c(0:add.size), size = add.size,             shape1 = a + max(r), shape2 = b + max(n) - max(r))        graphics::plot(c(0:add.size), cdf, type = "S")    }    else {        print("Warning: please assign a stopping rule!")    }}, interval = time.interval)
 6: bayes.design(a = a, b = b, r = MM.r, stop.rule = "futility",     p0 = 0.1)
An irrecoverable exception occurred. R is aborting now ...