heaviness_on_downstream.Rd
Heaviness on all downstream packages
heaviness_on_downstream(package, add_values_attr = FALSE, via = NULL,
total = FALSE, internal = FALSE)
A package name.
Whether to include "values" attribute? Internally used.
Whether to only consider downstream packages via a intermediate package?
Whether to return the total heaviness?
Whether to use internally calculated heaviness?
It is calculated based on a specific CRAN/Bioconductor snapshot. The version is set via pkgndep_opt
$heaviness_db_version.
The value is the mean heaviness of the package on all its downstream packages. Denote n
as the number of all its downstream packages,
k_i
as the number of required packages for package i,
v_1
as the total number of required packages for all downstream packages, i.e. v_1 = sum_i^n {k_i}
. Denote p_i
as the number of required packages if moving package
to Suggests
,
and v_2
as the total number of required packages, i.e. v_1 = sum_i^n {p_i}
. The final heaviniss on downstream packages is (v_1 - v_2)/n
.
Note since the interaction from package
to its downstream packages may go through several intermediate packages, which means, the reduction of required packages
for a downstream package might be joint effects from all its upstream packages, thus, to properly calculate the heaviness of a package to its downstream packages, we first make
a copy of the package database and move package
to Suggests
for all packages which depends on package
. Then for all downstream packages of package
, dependency analysis
by pkgndep
is redone with the modified package database. Finally, the heaviness on downstream packages is collected and the mean heaviness is calculated.
# \dontrun{
heaviness_on_downstream("ComplexHeatmap")
#> [1] 8.933333
#> attr(,"all_downstream_pkgs")
#> [1] 90
# }