isAvailable: Is a required package available?

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/utils.R

Description

Convenience function for checking and installing required packages.

Usage

1
isAvailable(pkg, type = c("annotation", "software", "data"))

Arguments

pkg

Character vector of length 1. A valid name of an existing R package.

type

Character vector of length 1. What type of package is this? Choose one out of 'annotation', 'software', or 'data' package.

Details

Checks whether a required package is available in the library. If yes, the package is loaded via requireNamespace. If not, the package is optionally installed via install and, subsequently, loaded via requireNamespace.

Value

None. See details.

Author(s)

Ludwig Geistlinger <Ludwig.Geistlinger@sph.cuny.edu>

See Also

require, install

Examples

1
2
3
    
        isAvailable("EnrichmentBrowser", type="software")
         

EnrichmentBrowser documentation built on Dec. 12, 2020, 2 a.m.