Error(s) in re-building vignettes:
  ...
--- re-building ‘bayesCT.Rmd’ using rmarkdown
--- finished re-building ‘bayesCT.Rmd’

--- re-building ‘binomial.Rmd’ using rmarkdown

Attaching package: 'bayesCT'

The following object is masked from 'package:stats':

    simulate


 *** caught segfault ***
address (nil), cause 'unknown'

Traceback:
 1: as.list(expr[-1L])
 2: prepare_first(rhs)
 3: split_chain(match.call(), env = env)
 4: bind_rows(data_control_success_impute, data_treatment_success_impute) %>%     mutate(Y = Y_impute) %>% select(-Y_impute)
 5: (function (p_treatment, p_control = NULL, y0_treatment = NULL,     N0_treatment = NULL, y0_control = NULL, N0_control = NULL,     N_total, lambda = 0.3, lambda_time = NULL, interim_look = NULL,     EndofStudy, prior = c(1, 1), block = 2, rand_ratio = c(1,         1), prop_loss_to_followup = 0.1, alternative = "greater",     h0 = 0, futility_prob = 0.05, expected_success_prob = 0.9,     prob_ha = 0.95, N_impute = 10, number_mcmc = 10000, discount_function = "identity",     alpha_max = 1, fix_alpha = FALSE, weibull_scale = 0.135,     weibull_shape = 3, method = "fixed") {    if (!is.null(p_control)) {        stopifnot(p_control > 0 & p_control < 1)    }    if (!is.null(y0_treatment) | !is.null(N0_treatment)) {        stopifnot((y0_treatment > 0 & N0_treatment > 0), y0_treatment <=             N0_treatment, (discount_function == "identity" |             discount_function == "weibull" | discount_function ==             "scaledweibull"))    }    if (!is.null(y0_control) | !is.null(N0_control)) {        stopifnot((y0_control > 0 & N0_control > 0), y0_control <=             N0_control)    }    if (!is.null(interim_look)) {        stopifnot(all(N_total > interim_look))    }    stopifnot((p_treatment < 1 & p_treatment > 0), length(lambda) ==         (length(lambda_time) + 1), EndofStudy > 0, block%%sum(rand_ratio) ==         0, (prop_loss_to_followup >= 0 & prop_loss_to_followup <         0.75), (h0 >= -1 & h0 < 1), (futility_prob < 0.2 & futility_prob >=         0), (expected_success_prob > 0.7 & expected_success_prob <=         1), (prob_ha > 0.7 & prob_ha < 1), N_impute > 0)    if (alternative != "two-sided" & alternative != "greater" &         alternative != "less") {        stop("The input for alternative is wrong!")    }    analysis_at_enrollnumber <- c(interim_look, N_total)    enrollment <- enrollment(param = lambda, N_total = N_total,         time = lambda_time)    if (!is.null(p_control)) {        group <- randomization(N_total = N_total, block = block,             allocation = rand_ratio)    }    else {        group <- rep(1, N_total)    }    if (!is.null(p_control)) {        sim <- rbinom(N_total, 1, prob = group * p_treatment +             (1 - group) * p_control)        control <- sim[group == 0]    }    else {        sim <- rbinom(N_total, 1, p_treatment)    }    treatment <- sim[group == 1]    n_loss_to_fu <- ceiling(prop_loss_to_followup * N_total)    loss_to_fu <- rep(FALSE, N_total)    loss_to_fu[sample(1:N_total, n_loss_to_fu)] <- TRUE    data_total <- data.frame(Y = sim, treatment = group, enrollment = enrollment,         id = 1:N_total, loss_to_fu = loss_to_fu)    stop_futility <- 0    stop_expected_success <- 0    if (length(analysis_at_enrollnumber) > 1) {        for (i in 1:(length(analysis_at_enrollnumber) - 1)) {            data_interim <- data_total %>% mutate(subject_enrolled = id <=                 analysis_at_enrollnumber[i], subject_impute_futility = !subject_enrolled) %>%                 group_by(subject_enrolled) %>% mutate(subject_impute_success = (enrollment[analysis_at_enrollnumber[i]] -                 enrollment <= EndofStudy & subject_enrolled) |                 (subject_enrolled & loss_to_fu))            data <- data_interim %>% filter(subject_enrolled,                 !subject_impute_success)            if (!is.null(p_control)) {                y_c <- sum(data$Y[data$treatment == 0])                N_c <- length(data$Y[data$treatment == 0])            }            else {                y_c <- NULL                N_c <- NULL            }            post <- bdpbinomial(y_t = sum(data$Y[data$treatment ==                 1]), N_t = length(data$Y[data$treatment == 1]),                 y_c = y_c, N_c = N_c, y0_t = y0_treatment, N0_t = N0_treatment,                 y0_c = y0_control, N0_c = N0_control, discount_function = discount_function,                 number_mcmc = number_mcmc, a0 = prior[1], b0 = prior[2],                 alpha_max = alpha_max, fix_alpha = fix_alpha,                 weibull_scale = weibull_scale, weibull_shape = weibull_shape,                 method = method)            futility_test <- 0            expected_success_test <- 0            for (j in 1:N_impute) {                data_control_success_impute <- data_interim %>%                   filter(treatment == 0) %>% mutate(Y_impute = ifelse(subject_impute_success &                   subject_enrolled, rbinom(n(), 1, p_control),                   Y))                data_treatment_success_impute <- data_interim %>%                   filter(treatment == 1) %>% mutate(Y_impute = ifelse(subject_impute_success &                   subject_enrolled, rbinom(n(), 1, p_treatment),                   Y))                data_success_impute <- bind_rows(data_control_success_impute,                   data_treatment_success_impute) %>% mutate(Y = Y_impute) %>%                   select(-Y_impute)                data <- data_success_impute %>% filter(subject_enrolled)                if (!is.null(p_control)) {                  y_c <- sum(data$Y[data$treatment == 0])                  N_c <- length(data$Y[data$treatment == 0])                }                else {                  y_c <- NULL                  N_c <- NULL                }                post_imp <- bdpbinomial(y_t = sum(data$Y[data$treatment ==                   1]), N_t = length(data$Y[data$treatment ==                   1]), y_c = y_c, N_c = N_c, y0_t = y0_treatment,                   N0_t = N0_treatment, y0_c = y0_control, N0_c = N0_control,                   discount_function = discount_function, number_mcmc = number_mcmc,                   a0 = prior[1], b0 = prior[2], alpha_max = alpha_max,                   fix_alpha = fix_alpha, weibull_scale = weibull_scale,                   weibull_shape = weibull_shape, method = method)                if (!is.null(p_control)) {                  if (alternative == "two-sided") {                    effect_imp <- post_imp$posterior_treatment$posterior -                       post_imp$posterior_control$posterior                    success <- max(c(mean(effect_imp > h0), mean(-effect_imp >                       h0)))                  }                  else if (alternative == "greater") {                    effect_imp <- post_imp$posterior_treatment$posterior -                       post_imp$posterior_control$posterior                    success <- mean(effect_imp > h0)                  }                  else {                    effect_imp <- post_imp$posterior_treatment$posterior -                       post_imp$posterior_control$posterior                    success <- mean(-effect_imp > h0)                  }                }                else {                  effect_imp <- post_imp$final$posterior                  if (alternative == "two-sided") {                    success <- max(c(mean(effect_imp - p_treatment >                       h0), mean(p_treatment - effect_imp > h0)))                  }                  else if (alternative == "greater") {                    success <- mean(effect_imp - p_treatment >                       h0)                  }                  else {                    success <- mean(p_treatment - effect_imp >                       h0)                  }                }                if (success > prob_ha) {                  expected_success_test <- expected_success_test +                     1                }                data_control_futility_impute <- data_success_impute %>%                   filter(treatment == 0) %>% mutate(Y_impute = ifelse(subject_impute_futility,                   rbinom(n(), 1, p_control), Y))                data_treatment_futility_impute <- data_success_impute %>%                   filter(treatment == 1) %>% mutate(Y_impute = ifelse(subject_impute_futility,                   rbinom(n(), 1, p_treatment), Y))                data_futility_impute <- bind_rows(data_control_futility_impute,                   data_treatment_futility_impute) %>% mutate(Y = Y_impute) %>%                   select(-Y_impute)                data <- data_futility_impute                if (!is.null(p_control)) {                  y_c <- sum(data$Y[data$treatment == 0])                  N_c <- length(data$Y[data$treatment == 0])                }                else {                  y_c <- NULL                  N_c <- NULL                }                post_imp <- bdpbinomial(y_t = sum(data$Y[data$treatment ==                   1]), N_t = length(data$Y[data$treatment ==                   1]), y_c = y_c, N_c = N_c, y0_t = y0_treatment,                   N0_t = N0_treatment, y0_c = y0_control, N0_c = N0_control,                   discount_function = discount_function, number_mcmc = number_mcmc,                   a0 = prior[1], b0 = prior[2], alpha_max = alpha_max,                   fix_alpha = fix_alpha, weibull_scale = weibull_scale,                   weibull_shape = weibull_shape, method = method)                if (!is.null(p_control)) {                  if (alternative == "two-sided") {                    effect_imp <- post_imp$posterior_treatment$posterior -                       post_imp$posterior_control$posterior                    success <- max(c(mean(effect_imp > h0), mean(-effect_imp >                       h0)))                  }                  else if (alternative == "greater") {                    effect_imp <- post_imp$posterior_treatment$posterior -                       post_imp$posterior_control$posterior                    success <- mean(effect_imp > h0)                  }                  else {                    effect_imp <- post_imp$posterior_treatment$posterior -                       post_imp$posterior_control$posterior                    success <- mean(-effect_imp > h0)                  }                }                else {                  effect_imp <- post_imp$final$posterior                  if (alternative == "two-sided") {                    success <- max(c(mean(effect_imp - p_treatment >                       h0), mean(p_treatment - effect_imp > h0)))                  }                  else if (alternative == "greater") {                    success <- mean(effect_imp - p_treatment >                       h0)                  }                  else {                    success <- mean(p_treatment - effect_imp >                       h0)                  }                }                if (success > prob_ha) {                  futility_test <- futility_test + 1                }            }            if (expected_success_test/N_impute > expected_success_prob) {                stop_expected_success <- 1                stage_trial_stopped <- analysis_at_enrollnumber[i]                break            }            if (futility_test/N_impute < futility_prob) {                stop_futility <- 1                stage_trial_stopped <- analysis_at_enrollnumber[i]                break            }            if (analysis_at_enrollnumber[i + 1] == N_total) {                stage_trial_stopped <- analysis_at_enrollnumber[i +                   1]                break            }        }        if (!is.null(p_control)) {            if (alternative == "two-sided") {                effect_int <- post$posterior_treatment$posterior -                   post$posterior_control$posterior            }            else if (alternative == "greater") {                effect_int <- post$posterior_treatment$posterior -                   post$posterior_control$posterior            }            else {                effect_int <- post$posterior_treatment$posterior -                   post$posterior_control$posterior            }        }        else {            effect_int <- post$final$posterior        }        N_enrolled <- nrow(data_interim[data_interim$id <= stage_trial_stopped,             ])    }    else {        N_enrolled <- N_total        stage_trial_stopped <- N_total        stop_futility <- 0        stop_expected_success <- 0    }    data_final <- data_total %>% filter(id <= stage_trial_stopped,         !loss_to_fu)    if (!is.null(p_control)) {        y_c <- sum(data_final$Y[data_final$treatment == 0])        N_c <- length(data_final$Y[data_final$treatment == 0])    }    else {        y_c <- NULL        N_c <- NULL    }    post_final <- bdpbinomial(y_t = sum(data_final$Y[data_final$treatment ==         1]), N_t = length(data_final$Y[data_final$treatment ==         1]), y_c = y_c, N_c = N_c, y0_t = y0_treatment, N0_t = N0_treatment,         y0_c = y0_control, N0_c = N0_control, number_mcmc = number_mcmc,         discount_function = discount_function, a0 = prior[1],         b0 = prior[2], alpha_max = alpha_max, fix_alpha = fix_alpha,         weibull_scale = weibull_scale, weibull_shape = weibull_shape,         method = method)    if (!is.null(p_control)) {        if (alternative == "two-sided") {            effect <- post_final$posterior_treatment$posterior -                 post_final$posterior_control$posterior            post_paa <- max(c(mean(effect > h0), mean(-effect >                 h0)))        }        else if (alternative == "greater") {            effect <- post_final$posterior_treatment$posterior -                 post_final$posterior_control$posterior            post_paa <- mean(effect > h0)        }        else {            effect <- post_final$posterior_treatment$posterior -                 post_final$posterior_control$posterior            post_paa <- mean(-effect > h0)        }    }    else {        effect <- post_final$final$posterior        if (alternative == "two-sided") {            post_paa <- max(c(mean(effect - p_treatment > h0),                 mean(p_treatment - effect > h0)))        }        else if (alternative == "greater") {            post_paa <- mean(effect - p_treatment > h0)        }        else {            post_paa <- mean(p_treatment - effect > h0)        }    }    N_treatment <- sum(data_final$treatment)    N_control <- sum(!data_final$treatment)    results_list <- list(p_treatment = p_treatment, p_control = p_control,         prob_of_accepting_alternative = prob_ha, margin = h0,         alternative = alternative, interim_look = interim_look,         N_treatment = N_treatment, N_control = N_control, N_complete = N_treatment +             N_control, N_enrolled = N_enrolled, N_max = N_total,         post_prob_accept_alternative = post_paa, est_final = mean(effect),         stop_futility = stop_futility, stop_expected_success = stop_expected_success)    if (length(analysis_at_enrollnumber) > 1) {        results_list <- c(results_list, est_interim = mean(effect_int))    }    results_list})(p_treatment = 0.08, N_total = 900, EndofStudy = 50, prop_loss_to_followup = 0.1,     interim_look = c(600, 700, 800), lambda = c(0.3, 1), lambda_time = 25,     h0 = -0.03, futility_prob = 0.05, prob_ha = 0.95, expected_success_prob = 0.9,     alternative = "less", N_impute = 25, number_mcmc = 1000,     prior = c(5, 5), y0_treatment = 5, N0_treatment = 55, discount_function = "identity",     alpha_max = 1, fix_alpha = FALSE, weibull_scale = 0.135,     weibull_shape = 3, method = "fixed")
 6: do.call(binomialBACT, input)
 7: simulate(., no_of_sim = 10)
 8: function_list[[k]](value)
 9: withVisible(function_list[[k]](value))
10: freduce(value, `_function_list`)
11: `_fseq`(`_lhs`)
12: eval(quote(`_fseq`(`_lhs`)), env, env)
13: eval(quote(`_fseq`(`_lhs`)), env, env)
14: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
15: value %>% simulate(no_of_sim = 10)
16: eval(expr, envir, enclos)
17: eval(expr, envir, enclos)
18: withVisible(eval(expr, envir, enclos))
19: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler,     error = eHandler, message = mHandler)
20: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir,     enclos)), warning = wHandler, error = eHandler, message = mHandler))
21: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr,     envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
22: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos,     debug = debug, last = i == length(out), use_try = stop_on_error !=         2L, keep_warning = keep_warning, keep_message = keep_message,     output_handler = output_handler, include_timing = include_timing)
23: evaluate::evaluate(...)
24: evaluate(code, envir = env, new_device = FALSE, keep_warning = !isFALSE(options$warning),     keep_message = !isFALSE(options$message), stop_on_error = if (options$error &&         options$include) 0L else 2L, output_handler = knit_handlers(options$render,         options))
25: in_dir(input_dir(), evaluate(code, envir = env, new_device = FALSE,     keep_warning = !isFALSE(options$warning), keep_message = !isFALSE(options$message),     stop_on_error = if (options$error && options$include) 0L else 2L,     output_handler = knit_handlers(options$render, options)))
26: block_exec(params)
27: call_block(x)
28: process_group.block(group)
29: process_group(group)
30: withCallingHandlers(if (tangle) process_tangle(group) else process_group(group),     error = function(e) {        setwd(wd)        cat(res, sep = "\n", file = output %n% "")        message("Quitting from lines ", paste(current_lines(i),             collapse = "-"), " (", knit_concord$get("infile"),             ") ")    })
31: process_file(text, output)
32: knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
33: rmarkdown::render(file, encoding = encoding, quiet = quiet, envir = globalenv(),     output_dir = getwd(), ...)
34: vweave_rmarkdown(...)
35: engine$weave(file, quiet = quiet, encoding = enc)
36: doTryCatch(return(expr), name, parentenv, handler)
37: tryCatchOne(expr, names, parentenv, handlers[[1L]])
38: tryCatchList(expr, classes, parentenv, handlers)
39: tryCatch({    engine$weave(file, quiet = quiet, encoding = enc)    setwd(startdir)    output <- find_vignette_product(name, by = "weave", engine = engine)    if (!have.makefile && vignette_is_tex(output)) {        texi2pdf(file = output, clean = FALSE, quiet = quiet)        output <- find_vignette_product(name, by = "texi2pdf",             engine = engine)    }}, error = function(e) {    OK <<- FALSE    message(gettextf("Error: processing vignette '%s' failed with diagnostics:\n%s",         file, conditionMessage(e)))})
40: tools:::.buildOneVignette("binomial.Rmd", "/home/hornik/tmp/R.check/r-release-gcc/Work/PKGS/bayesCT.Rcheck/vign_test/bayesCT",     TRUE, FALSE, "binomial", "UTF-8", "/tmp/RtmpRQKfw5/file31612e479af5.rds")
An irrecoverable exception occurred. R is aborting now ...
Segmentation fault
--- re-building ‘normal.Rmd’ using rmarkdown

Attaching package: 'bayesCT'

The following object is masked from 'package:stats':

    simulate

--- finished re-building ‘normal.Rmd’

--- re-building ‘time-to-event.Rmd’ using rmarkdown

Attaching package: 'bayesCT'

The following object is masked from 'package:stats':

    simulate

--- finished re-building ‘time-to-event.Rmd’

SUMMARY: processing the following file failed:
  ‘binomial.Rmd’

Error: Vignette re-building failed.
Execution halted