I have found box as a useful package and I was curious if we could implement a function that would allow for certain R scripts to either run as an R script, or import exported functionality into another with box::use.
Since R doesn't have a mangling system like python, I imagine it would look something like
#' @export
execute_function <- function(...) {
# ...
}
# only execute function if Rscript is called by command line
# otherwise, just make it available for module
if (is_rscript_exec(file_pattern = "My_script_name.R")) {
execute_function(...)
}
Please describe your feature request
I have found box as a useful package and I was curious if we could implement a function that would allow for certain R scripts to either run as an R script, or import exported functionality into another with
box::use
.Since R doesn't have a mangling system like python, I imagine it would look something like