summary.cranly_dependence_tree {cranly}R Documentation

summary method for cranly_dependence_tree objects

Description

Hard dependence summaries for R packages from a cranly_dependence_tree object

Usage

## S3 method for class 'cranly_dependence_tree'
summary(object, ...)

Arguments

object

a cranly_dependence_tree object.

...

currently not used.

Details

The summary method for a cranly_dependence_tree object returns the number of generations the R package(s) in the object inherit from (n_generations), the immediate parents of the R package(s) (parents), and a dependence index dependence_index defined as

iCp;ip1NigiiCp;ip1Ni -\frac{\sum_{i \in C_p; i \ne p} \frac{1}{N_i} g_i}{\sum_{i \in C_p; i \ne p} \frac{1}{N_i}}

where CpC_p is the dependence tree for the package(s) pp, NiN_i is the total number of packages that depend, link or import package ii, and gig_i is the generation that package ii appears in the dependence tree of package(s) pp. The generation takes values on the non-positive integers, with the package(s) pp being placed at generation 0, the packages that pp links to, depends or imports at generation -1 and so on.

A dependence index of zero means that the pp only has immediate parents. The dependence index weights the dependencies based on how popular these are, in the sense that the index is not penalized if the package depends on popular packages. The greatest the dependence index is the more baggage the package carries, and the maintainers may want to remove any dependencies that are not necessary.

Value

A list with components n_generations, parents, and dependence_index.

See Also

build_dependence_tree.cranly_network() compute_dependence_tree()

Examples


cran_db <- clean_CRAN_db()
package_network <- build_network(cran_db)

## Two light packages
dep_tree <- build_dependence_tree(package_network, package = "brglm")
summary(dep_tree)

dep_tree <- build_dependence_tree(package_network, package = "gnm")
summary(dep_tree)

## A somewhat heavier package (sorry)...
dep_tree <- build_dependence_tree(package_network, package = "cranly")
summary(dep_tree)




[Package cranly version 0.6.0 Index]