metric_score.pkg_metric_exported_namespace: Score a package for the number of exported objects

View source: R/assess_exported_namespace.R

metric_score.pkg_metric_exported_namespaceR Documentation

Score a package for the number of exported objects

Description

Score a package for the number of exported objects it has; regularized Convert the number of exported objects length(x) into a validation score [0,1]

1 / (1 + exp(-0.5 * (sqrt(length(x)) + sqrt(5))))

Usage

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

Arguments

x

a pkg_metric_exported_namespace packge metric object

...

additional arguments unused

Details

The scoring function is the classic logistic curve

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

with a square root scale for the number of exported objects x = sqrt(length(x)), sigmoid midpoint is 25 exported objects, ie. x[0] = sqrt(5), and logistic growth rate of k = 0.25.

1 / (1 + exp(-0.25 * sqrt(length(x))-sqrt(25)))

Value

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

Examples

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


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