futureverse / futureverse/future
R options: options() are not passed down to futures - should they? (document either way)
- Dominant language
- R
- Stars
- 1k
- Forks
- 92
- PR merge metrics
- No merged PRs in 30d
Description
I'm adding this as a reminder to myself to document this (next release), but also to consider more automated solutions (a future release):
R's global `options()` are _not_ passed down to futures. This has to be done manually right now, e.g.
```r
fopts <- options()[c("digits", "repos")]
f <- future({
options(fopts)
[...]
})
```
This works, but it would be nice to have an automated version of this as well (cf. globals and packages) to better capture the state of the calling R process. Doing this might be a bit tricky since some options are read only / shouldn't be changed and others are specific the local machine, which may not work on a remote machine. Maybe it's possible to use static-code inspection to identify what options are used (similar to how globals are identified).
Contributor guide
Assessment
This issue has not been assessed yet.