Skip to contents

Locally set target options for the duration of an expression, without permanently modifying the global state.

Usage

tar_option_with(expression, ..., envir_with = parent.frame())

Arguments

expression

An R expression to run with the local option.

...

Named arguments to tar_option_set() to temporarily set for the duration of expression.

envir_with

Environment to evaluate expression.

Value

NULL (invisibly).

Examples

  tar_option_with(
    tar_target(data, get_data()),
    packages = "dplyr",
    cue = tar_cue(mode = "never")
  )
#> <tar_stem> 
#>   name: data 
#>   description:  
#>   command:
#>     get_data() 
#>   format: rds 
#>   repository: local 
#>   iteration method: vector 
#>   error mode: stop 
#>   memory mode: auto 
#>   storage mode: worker 
#>   retrieval mode: auto 
#>   deployment mode: worker 
#>   priority: 0 
#>   resources:
#>     list() 
#>   cue:
#>     seed: TRUE
#>     file: TRUE
#>     iteration: TRUE
#>     repository: TRUE
#>     format: TRUE
#>     depend: TRUE
#>     command: TRUE
#>     mode: never 
#>   packages:
#>     dplyr 
#>   library:
#>     NULL