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

> ### Name: BB.aniplot
> ### Title: Sequentially monitor patients using Beta-Binomial posterior
> ###   probability
> ### Aliases: BB.aniplot
> 
> ### ** Examples
> 
> # Using APL data
> r=rep(0,6)
> BB.aniplot(a=1,b=1,r=r, alpha=0.05, seed=1234)
Prior: Beta(1,1) 

======== Cohort Number: 1 ======== 
Observations -- Sample Size: 1(1)  ||  Number of Response: 0(0)  ||  Number of Failure: 1(1)
  Observed Response Rate: 0
Posterior: Beta(1,2) 
  Posterior Mean: 0.333
  95% Credible Interval: (0.0126,0.842) 

======== Cohort Number: 2 ======== 
Observations -- Sample Size: 2(1)  ||  Number of Response: 0(0)  ||  Number of Failure: 2(1)
  Observed Response Rate: 0
Posterior: Beta(1,3) 
  Posterior Mean: 0.25
  95% Credible Interval: (0.0084,0.708) 

======== Cohort Number: 3 ======== 
Observations -- Sample Size: 3(1)  ||  Number of Response: 0(0)  ||  Number of Failure: 3(1)
  Observed Response Rate: 0
Posterior: Beta(1,4) 
  Posterior Mean: 0.2
  95% Credible Interval: (0.00631,0.602) 

======== Cohort Number: 4 ======== 
Observations -- Sample Size: 4(1)  ||  Number of Response: 0(0)  ||  Number of Failure: 4(1)
  Observed Response Rate: 0
Posterior: Beta(1,5) 
  Posterior Mean: 0.167
  95% Credible Interval: (0.00505,0.522) 

======== Cohort Number: 5 ======== 
Observations -- Sample Size: 5(1)  ||  Number of Response: 0(0)  ||  Number of Failure: 5(1)
  Observed Response Rate: 0
Posterior: Beta(1,6) 
  Posterior Mean: 0.143
  95% Credible Interval: (0.00421,0.459) 

======== Cohort Number: 6 ======== 
Observations -- Sample Size: 6(1)  ||  Number of Response: 0(0)  ||  Number of Failure: 6(1)
  Observed Response Rate: 0
Posterior: Beta(1,7) 
  Posterior Mean: 0.125
  95% Credible Interval: (0.00361,0.41) 


 *** 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 (output == TRUE) {        cat("Prior: Beta(", a, ",", b, ") \n\n", sep = "")    }    for (i in 1:M) {        x <- seq(0, 1, 0.01)        y.prior <- dbeta(x, a, b)        mu0 <- a/(a + b)        a1 <- a + r[i]        b1 <- b + N - r[i]        mu1 <- a1/(a1 + b1)        y.post <- dbeta(x, a1, b1)        lh <- stats::dbinom(r[i], N, x) * (N + 1)        if (output == TRUE) {            LB <- stats::qbeta(alpha/2, a1, b1)            UB <- stats::qbeta(alpha/2, a1, b1, lower.tail = F)            cat("======== Cohort Number: ", i, " ======== \n",                 sep = "")            cat("Observations -- Sample Size: ", i * N, "(",                 N, ")", "  ||  Number of Response: ", sum(r[1:i]),                 "(", r[i], ")", "  ||  Number of Failure: ",                 i * N - sum(r[1:i]), "(", N - r[i], ")", "\n",                 sep = "")            cat("  Observed Response Rate: ", sum(r[1:i])/(i *                 N), "\n", sep = "")            cat("Posterior: Beta(", a1, ",", b1, ") \n", sep = "")            cat("  Posterior Mean: ", mu1, "\n", sep = "")            cat("  ", (1 - alpha) * 100, "% Credible Interval: (",                 LB, ",", UB, ") \n\n", sep = "")        }        ylim <- range(0, min(20, max(y.prior)), min(20, max(y.post)),             max(lh))        graphics::plot(x, y.prior, type = "l", col = "blue",             xlim = c(0, 1), ylim = ylim, xlab = "Response Rate",             ylab = "Density", main = paste(N * i, "patients are included",                 sep = " "))        graphics::lines(x, y.post, col = "red")        graphics::lines(x, lh, col = "dark green")        graphics::legend("topright", c("Prior", "Posterior",             "Likelihood"), lty = 1, col = c("blue", "red", "dark green"))        a <- a1        b <- b1    }}, interval = time.interval)
 6: BB.aniplot(a = 1, b = 1, r = r, alpha = 0.05, seed = 1234)
An irrecoverable exception occurred. R is aborting now ...