From 0dd32d46bf3f9abc73be2b02e235b32c9ee9383d Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Wed, 24 Apr 2024 21:41:28 +0100 Subject: [PATCH] handle backend correctly in opts --- R/opts.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/R/opts.R b/R/opts.R index cf24eaba1..17cfe8eca 100644 --- a/R/opts.R +++ b/R/opts.R @@ -983,11 +983,13 @@ stan_opts <- function(object = NULL, } else { stop("`object` must be a stan model object") } + } else { + backend <- arg_match(backend, values = c("rstan", "cmdstanr")) + opts <- c(opts, list(backend = backend)) } opts <- c(opts, list( object = object, - method = method, - backend = backend + method = method )) if (method == "sampling") { opts <- c(