If a package is not installed on the computer/server intended to run a final script, this function can take the script and export it together with all objects (functions, methods et cetera) from specified R packages. It might thereafter be possible to transfer the script and to run it even if all packages are not installed by the host.
exportr(
script = NULL,
packages,
recursive = TRUE,
outfile = "./generated_r_script.R",
force = FALSE
)
connection with script (file) to append to function definitions
name of packages (as character) to be explicitly included.
argument passed to package_dependencies
filename for dump file
this function works only in interactive mode by default but
output can be forced by this argument set to TRUE
nothing (function called for its side effects)
Some packages use external dependencies and/or compiled code. This is not handled by the function. Hence, there is no guarantee that the script will actually work!