powered by
Calls find.package() to check if the all packages are installed.
find.package()
check_packages_installed( pkgs, warn = TRUE, msg = "The following packages are required but not installed: %s" )
(logical()) named with package names. TRUE if the respective package is installed, FALSE otherwise.
logical()
TRUE
FALSE
(character()) Packages to check.
character()
(logical(1)) If TRUE, signals a warning of class "packageNotFoundWarning" about the missing packages.
logical(1)
"packageNotFoundWarning"
(character(1)) Format of the warning message. Use "%s" as placeholder for the list of packages.
character(1)
"%s"
check_packages_installed(c("mlr3misc", "foobar"), warn = FALSE) # catch warning tryCatch(check_packages_installed(c("mlr3misc", "foobaaar")), packageNotFoundWarning = function(w) as.character(w))
Run the code above in your browser using DataLab