diff --git a/DESCRIPTION b/DESCRIPTION index 1f95f0c..0212c64 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -16,7 +16,7 @@ BugReports: https://github.com/mrc-ide/naomi.options/issues Additional_repositories: https://mrc-ide.r-universe.dev Imports: data.table, - glue, + glue (>= 1.8.0), jsonlite, traduire (>= 0.0.5), Suggests: diff --git a/R/utils.R b/R/utils.R index da5c633..eafa76c 100644 --- a/R/utils.R +++ b/R/utils.R @@ -38,10 +38,9 @@ recursive_scalar <- function(x) { #' @keywords internal #' build_json <- function(options_template, params) { - param_env <- list2env(params, parent = .GlobalEnv) tryCatch( - glue::glue(options_template, .envir = param_env, .open = '"<+', - .close = '+>"', .transformer = json_transformer), + glue::glue_data(params, options_template, .open = '"<+', + .close = '+>"', .transformer = json_transformer), error = function(e) { e$message <- t_("MODEL_OPTIONS_FAIL", list(message = e$message)) stop(e)