libordie: Load a library mutedly and quit (die) in case of failing

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

View source: R/libordie.R

Description

The specified library is loaded mutedly by suppressing all messages. If the library is not found, or its version under the specification of minVer, the R session dies with a message.

Usage

1
libordie(package, minVer, missing.quit.status = 1, ver.quit.status = 1)

Arguments

package

One package name (can be character or non-quoted symbol (see examples)

minVer

Optional, character string, the minimum working version

missing.quit.status

Integer, the status of quitting when the package was not found

ver.quit.status

Integer, the status of quitting when the package was found, but older than the minimum working version

Details

Only one package should be tested once.

Value

NULL if success, otherwise the session will be killed.

Author(s)

Jitao David Zhang <jitao_david.zhang@roche.com>

See Also

The function calls qqmsg internally to kill the session

Examples

1
2
3
4
5
if(interactive()) {
  libordie(stats)
  libordie("methods")
  libordie(base, minVer="2.15-1")
}

ribiosUtils documentation built on March 13, 2020, 2:54 a.m.