pkglist: Extract 'library' and 'require' calls in R and 'import' calls...

View source: R/Rlibs.R

pkglistR Documentation

Extract library and require calls in R and import calls from Python

Description

pkglist counts the number of library/require/import calls for R and Python commands within the files. It checks the availability of a package/module via utils::available.packages() (for R) and via PyPI (for Python). If code=TRUE is set, it returns R/Python code for installing packages/modules. Otherwise, a table with the number of library or import calls is returned.

Usage

pkglist(files, code = TRUE, repos = getOption("repos"))

Rlibs(files, code = TRUE, repos = getOption("repos"))

modlist(files, code = TRUE, repos = getOption("repos"))

Arguments

files

character: file name(s)

code

logical: should names given back or code for init scrips? (default: TRUE)

repos

character: the base URL(s) of the repositories to use (default: getoption("repos"))

Value

a table how frequently the packages are called or R Code to install them

Examples

if (interactive()) {
  files <- list.files(pattern="*.(R|py)$", full.names=TRUE, recursive=TRUE)
  pkglist(files)
}

sigbertklinke/mmstat4 documentation built on Sept. 13, 2024, 4:46 p.m.