You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If some functions, own or third-party, resets all R options to what they were prior to loading ff, then some ff functions fail because querying those options result in NULL values. Imagine a function that reset all R options using on.exit() to protect against side effects from some rough function call setting, say, options(warn = 2).
I'd like to argue that code should not make assumptions about R options being set, even for "internal" R options. My suggestions is to add defaults to all getOption(), e.g.
path<- getOption("fftempdir", stop("Option 'fftempdir' has been removed. It is essential for the 'ff' package to function. Please restart your R session"))
A friendly nudge about this one. I don't think resetting R options should break a package this much. I think it wouldn't be too hard to recover from it, if it happens.
Issue
If some functions, own or third-party, resets all R options to what they were prior to loading ff, then some ff functions fail because querying those options result in
NULL
values. Imagine a function that reset all R options usingon.exit()
to protect against side effects from some rough function call setting, say,options(warn = 2)
.Reproducible example
Troubleshooting
The problem is that
ff::fftempfile()
assumes that R optionfftempdir
is always set;ff/R/fileutil.R
Lines 181 to 187 in 46bc1c5
Suggestion
I'd like to argue that code should not make assumptions about R options being set, even for "internal" R options. My suggestions is to add defaults to all
getOption()
, e.g.Alternatively, give an informative error message:
Session info
The text was updated successfully, but these errors were encountered: