Generates a dockerfile based on an R script, analyzing its dependencies
and creating a container that can run the script.
Details
This function analyzes the R script to identify package dependencies by
scanning for library() and require() calls. It then:
Creates a dockerfile with the specified base image
Adds necessary system requirements for the detected packages
Installs the required R packages
Copies the script to the container
Sets up a command to run the script
The dockerfile can be customized further after creation if needed.
See also
dk_from_session() for creating from the current session,
dk_from_renv() for creating from renv.lock files, &
dk_from_description() for creating from DESCRIPTION files
Other dockerfile from environment functions:
dk_from_description(),
dk_from_renv(),
dk_from_session()