-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
This function fails, despite all possible places and ways i is defined:
test <- function(i = 6) {
i <- 7
map <- NULL
for (i in 1:5) {
map[[i]] <- mirai::mirai({ Sys.sleep(i); i },
.args = list(i = 8),
i = 9)
}
cli.opts <- list(type = "task",
format = "{cli::pb_spin} Input: {.strong {i}}")
mirai::collect_mirai(map, options = list(.progress = cli.opts))
}
test()
# Error in `"id" %in% names(args)`:
# ! Could not evaluate cli `{}` expression: `i`.
# Caused by error in `eval(expr, envir = envir)`:
# ! object 'i' not found
# Type .Last.error to see the more details.The only way I've found to make it work, is to set i in the global namespace. Is there a way to support custom formats such as the one above in .progress?
Metadata
Metadata
Assignees
Labels
No labels