metric_score.pkg_metric_dependencies: Score a package for dependencies

View source: R/assess_dependencies.R

metric_score.pkg_metric_dependenciesR Documentation

Score a package for dependencies

Description

Calculates a regularized score based on the number of dependencies a package has. Convert the number of dependencies NROW(x) into a validation score [0,1]

1 - 1 / (1 + exp(-0.5 * (NROW(x) + 4)))

Usage

## S3 method for class 'pkg_metric_dependencies'
metric_score(x, ...)

Arguments

x

a pkg_metric_dependencies packge metric object

...

additional arguments unused

Details

The scoring function is the classic logistic curve

/ (1 + exp(-k(x-x[0]))

x = NROW(x), sigmoid midpoint is 5 reverse dependencies, ie. x[0] = 4, and logistic growth rate of k = 0.5.

1 - 1 / (1 + exp(NROW(x)-4))

Value

numeric value between 0 (high number of dependencies) and 1 (low number of dependencies)

Examples

## Not run: metric_score(assess_dependencies(pkg_ref("riskmetric")))


pharmaR/riskmetric documentation built on April 30, 2024, 5:14 p.m.