#### Only run examples if ggplot2 is installed ####
if (requireNamespace("ggplot2", quietly = TRUE)){
# Setup a trial specification
binom_trial <- setup_trial_binom(arms = c("A", "B", "C", "D"),
control = "A",
true_ys = c(0.20, 0.18, 0.22, 0.24),
data_looks = 1:20 * 100)
# Run multiple simulation with a fixed random base seed
res_mult <- run_trials(binom_trial, n_rep = 25, base_seed = 12345)
# Plot trial statuses at each look according to total allocations
plot_status(res_mult, x_value = "total n")
}
if (requireNamespace("ggplot2", quietly = TRUE)){
# Plot trial statuses for all arms
plot_status(res_mult, arm = NA)
}
Run the code above in your browser using DataLab