-
Notifications
You must be signed in to change notification settings - Fork 76
Closed
Labels
Description
Prework
- I understand and agree to help guide.
- I understand and agree to contributing guide.
- New features take time and effort to create, and they take even more effort to maintain. So if the purpose of the feature is to resolve a struggle you are encountering personally, please consider first posting a "trouble" or "other" issue so we can discuss your use case and search for existing solutions first.
Proposal
Allow source
to change directory when sourcing external scripts. Default to FALSE
to be compatible (have exactly the same behavior) with current implementation.
targets::tar_source <- function (files = "R", chdir = FALSE, envir = targets::tar_option_get("envir"))
{
...
lapply(r_scripts, function(file) {
# eval(parse(text = readLines(file, warn = FALSE)), envir = envir)
source(file, local = envir, chdir = chdir, keep.source = FALSE)
invisible()
})
invisible()
}
Alternatively sys.source
could replace source