heaviness: Heaviness from parent packages

Description Usage Arguments Details Value Examples

View source: R/stat.R

Description

Heaviness from parent packages

Usage

1
heaviness(x, rel = FALSE, a = 10)

Arguments

x

An object returned by pkgndep.

rel

Whether to return the absolute measure or the relative measure.

a

A constant added for calculating the relative measure.

Details

The heaviness from a parent package is calculated as follows: If package B is in the "Depends"/"Imports"/"LinkingTo" fields of package A, which means, package B is necessary for package A, denote v1 as the total numbers of packages required for package A, and v2 as the total number of required packages if moving package B to "Suggests" (which means, now B is not necessary when for A). The absolute measure is simply v1 - v2 and relative measure is (v1 + a)/(v2 + a).

In the second scenario, if B is in the "Suggests/Enhances" fields of package A, now v2 is the total number of required packages if moving B to "Imports", the absolute measure is v2 - v1 and relative measure is (v2 + a)/(v1 + a).

Value

A numeric vector.

Examples

1
2
3
x = readRDS(system.file("extdata", "ComplexHeatmap_dep.rds", package = "pkgndep"))
heaviness(x)
heaviness(x, rel = TRUE)

pkgndep documentation built on Nov. 10, 2021, 5:08 p.m.