adjacency_matrix: Generates an adjacency matrix between functions in a package

Description Usage Arguments Value

Description

This function takes the name of an R package and explores each function within that package to map which other functions that function calls. This creates "dependency graph" between the functions, which can allow you to quickly understand how a package fits together, and also diagnose pathologies in package code like excessive or unwarranted coupling between functions or orphaned functions. The returned data is a matrix, by default a sparse 'Matrix' from the 'Matrix' package.

Usage

1
2
adjacency_matrix(package_name, coerce_to_matrix = FALSE,
  show_progress = FALSE)

Arguments

package_name

a character string containing the name of an installed package

coerce_to_matrix

If TRUE, return an R 'matrix' instead of a sparse 'Matrix'.

show_progress

a boolean indicating whether to display a progress bar.

Value

A square matrix where each row and column are functions in the package. The matrix is an adjacency function: a 1 in a cell indicates that the function named in the row calls the function named in the column.


aaronrudkin/werner documentation built on May 23, 2019, 6:03 a.m.