Set the anvl.backend option for a scope: local_backend() until the
calling frame exits, with_backend() for the duration of code. Every
array built and every operation run in that scope uses the backend, and R
values materialize at its default data types (see default_dtypes()).
Usage
local_backend(backend, envir = parent.frame())
with_backend(backend, code)Value
local_backend() returns the previous value of the option, as
list(anvl.backend = ), invisibly. with_backend() returns the result
of evaluating code.
Examples
f <- function() {
local_backend("quickr")
active_backend()
}
f()
#> [1] "quickr"
active_backend()
#> [1] "pjrt"
with_backend("quickr", active_backend())
#> [1] "quickr"