Learn R Programming

librarian (version 1.8.1)

check_installed: Check if packages are installed

Description

Check if packages are installed

Usage

check_installed(...)

Arguments

...

(Dots) Package names as bare names, strings, or a character vector. If left empty, lists all installed packages.

Value

If dots is empty, a character vector of all installed packages. Otherwise, return a named logical vector where TRUE means the package is installed.

Examples

Run this code
# NOT RUN {
check_installed()

#>   [1] "addinslist"  "antiword" " ape"  "assertthat"  ...

check_installed(c("utils", "stats"))

#> utils stats 
#> TRUE  TRUE 

check_installed("datasets", "base", fakepkg)

#> datasets     base  fakepkg 
#>     TRUE     TRUE    FALSE 
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab