When you configure R packages to install via an init script, it is possible for a package install to fail if dependencies are not installed.
You can use the R commands in a notebook to check that all of the packages correctly installed.
List installed packages
- Make a list of all R package names that you have listed in your init script or scripts.
- Enter the list of packages in this sample code.
%r my_packages <- list("<package-1>", "<package-2>", "<package-3>" ) find.package(my_packages, quiet=TRUE)
- The output is a list of all installed packages.
Verify the output against the input list to ensure that all packages were successfully installed.
List packages that did not install
- Make a list of all R package names that you have listed in your init script or scripts.
- Enter the list of packages in this sample code.
%r my_packages <- c("<package-1>", "<package-2>", "<package-3>" ) not_installed <- my_packages[!(my_packages %in% installed.packages()[ , "Package"])] print(not_installed)
- The output is a list of all packages that failed to install.
If you have packages that are consistently failing to install, you should enable cluster log delivery and review the cluster logs for failures.