checkPackages: checkPackages, installPackages

View source: R/checkPackages.R

checkPackagesR Documentation

checkPackages, installPackages

Description

Checks if a package is installed without loading it. Returns a logical vector with TRUE or FALSE for each package checked.

Usage

checkPackages(
  ...,
  plotmodule = NULL,
  add = c("tools", "devtools", "formatR", "highlight", "shiny", "shinydashboard",
    "shinydashboardPlus", "shinyWidgets", "DT", "sortable", "base64enc"),
  error = FALSE
)

installPackages(
  plotmodule = NULL,
  add = c("tools", "devtools", "formatR", "highlight", "shiny", "shinydashboard",
    "shinydashboardPlus", "shinyWidgets", "DT", "sortable", "base64enc")
)

Arguments

...

character: name(s) of package

plotmodule

character: name(s) of plot modules to check for packages

add

character: names of default packages to check (default: c("highlight", "formatR", "shiny", "shinydashboard", "shinydashboardPlus", "DT"))

error

logical: should a error thrown if one or more package are missing? (default: FALSE)

Value

TRUE if successful otherweise an error will be thrown

Examples

checkPackages("graphics", add=NULL)          # checks if 'graphics' is installed
if (interactive()) checkPackages("graphics") # checks if 'graphics', 'shiny', ... are installed
if (interactive()) installPackages()         # installs all packages to show ALL plots

sigbertklinke/smvgraph documentation built on Dec. 10, 2022, 9:13 a.m.