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
@rkrug originally raised #330 (comment) as a potential problem. By default, drake is sensitive to the environment in which make() is called. But I think we no longer need the session argument of make(). Reasons:
make(session = callr::r_vanilla) never actually solved Creating plan in Rmd file - knit() same chunk names #330 (comment). @rkrug did make a good point that maybe objects like x should not be in the new session. But what if x is a user-defined function? For those cases, we needed x to be in the new session's global environment after all, so callr::r_vanilla() did not turn out to be useful.
If you do not want to use the global environment, I recommend source()ing your scripts into a custom environment (new.env(parent = globalenv()) and then supplying it to the envir argument of make(). I should probably provide guidance on this in the manual.
@rkrug originally raised #330 (comment) as a potential problem. By default,
drake
is sensitive to the environment in whichmake()
is called. But I think we no longer need thesession
argument ofmake()
. Reasons:make(session = callr::r_vanilla)
never actually solved Creating plan in Rmd file -knit()
same chunk names #330 (comment). @rkrug did make a good point that maybe objects likex
should not be in the new session. But what ifx
is a user-defined function? For those cases, we neededx
to be in the new session's global environment after all, socallr::r_vanilla()
did not turn out to be useful.make(lock_envir = TRUE)
). It is still up to you to populate the environment, which admittedly requires diligence to stay consistent, but after that,make()
locks the environment during runtime to prevent it from being modified.The text was updated successfully, but these errors were encountered: