pkglist {mmstat4}R 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 in the files. If you set code==TRUE then returns R code for installing packages/modules. It checks via utils::available.packages() (for R) and via PyPI if a package/module is available. Otherwise a table with the number of library or import 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)
}

[Package mmstat4 version 0.2.1 Index]