checkNameSpace: check namespace

Description Usage Arguments Value Examples

View source: R/spsUtil.R

Description

Help you to check if you have certain packages and return missing package names

Usage

1
2
3
4
5
6
7
checkNameSpace(
  packages,
  quietly = FALSE,
  from = "CRAN",
  time_out = 1,
  on_timeout = {     FALSE }
)

Arguments

packages

vector of strings

quietly

bool, give you warning on fail?

from

string, where this package is from like, "CRAN", "GitHub", only for output message display purpose

time_out

numeric, how long to wait before reaching the time limit. Sometimes there are too many pkgs installed and takes too long to scan the whole list. Set this timeout in seconds to prevent the long waiting.

on_timeout

expressions, call back experssions to run when reaches timeout time. Default is return FALSE as indicating that package is missing (we can't find the package).

Value

vector of strings, of missing package names, character(0) if no missing

Examples

1
2
3
checkNameSpace("ggplot2")
checkNameSpace("random_pkg")
checkNameSpace("random_pkg", quietly = TRUE)

spsUtil documentation built on Oct. 31, 2021, 1:06 a.m.