From 30c6deb07df4119a5f21c260fc51e364992cf679 Mon Sep 17 00:00:00 2001 From: jamesaazam Date: Mon, 23 Oct 2023 15:41:35 +0100 Subject: [PATCH] Catch the dot-dot-dot and modify iter if present --- R/opts.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/opts.R b/R/opts.R index 0af88121a..885ca1977 100644 --- a/R/opts.R +++ b/R/opts.R @@ -549,6 +549,7 @@ rstan_sampling_opts <- function(cores = getOption("mc.cores", 1L), future = FALSE, max_execution_time = Inf, ...) { + dot_args <- list(...) opts <- list( cores = cores, warmup = warmup, @@ -560,8 +561,9 @@ rstan_sampling_opts <- function(cores = getOption("mc.cores", 1L), ) control_def <- list(adapt_delta = 0.95, max_treedepth = 15) opts$control <- modifyList(control_def, control) + dot_args$iter <- NULL opts$iter <- ceiling(samples / opts$chains) + opts$warmup - opts <- c(opts, ...) + opts <- c(opts, dot_args) return(opts) }