diff --git a/R/utils.R b/R/utils.R index a76b4ce0..a303eae0 100644 --- a/R/utils.R +++ b/R/utils.R @@ -92,7 +92,7 @@ configure_options <- function(opts, env = parent.frame()) { list( mc.cores = cores, bmm.silent = opts$silent, - bmm.sort_data = opts$sort_data + bmm.sort_data = opts$sort_data %||% getOption('bmm.sort_data', 'check') ), .local_envir = env) @@ -662,3 +662,7 @@ deprecated_args <- function(...) { 'The "parallel" argument is deprecated. Please use cores instead. See `help("brm")` for more information.') } + +`%||%` <- function(a, b) { + if (!is.null(a)) a else b +}