Skip to content

future() arguments for passing R options and environment variables #480

@HenrikBengtsson

Description

@HenrikBengtsson

There are cases where one needs to customize options and environment variables used by the future. This can be done by explicitly setting those in the future expression, but that might be tedious, especially to make sure that they are unset afterward. Having future() do it for us is easier and avoids some code clutter. Here's one idea:

# Set env var 'FOO' with its currently set value, if set + set 'BAR' to "42"
f <- future(..., envvars = c("FOO", BAR = "42"))

# Set R options 'foo' with its currently set value, if set + set 'bar' to 42L
f <- future(..., options = c("foo", BAR = 42L))

These arguments should be exposed also in map-reduce APIs, e.g. future.apply and furrr.

Possible concerns

  • All types of options and environment variables should not be exported; is that something that future should monitor/protect again?
  • In R, certain environment variables must be set before launching R; is that something that future should monitor/protect again?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions