SkillAgentSearch skills...

Depgraph

Provides an R function to plot the complete dependency graph of an R package and helps to cut down on dependencies.

Install / Use

/learn @crsh/Depgraph
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<!-- README.md is generated from README.Rmd. Please edit that file -->

depgraph: Plot the complete dependency graph of an R package

<!-- badges: start -->

CRAN/METACRAN Project Status: Active – The project has reached a stable, usable
state and is being actively
developed. GitHub last commit
(devel) GitHub bug
issues

<!-- badges: end -->

Provides a function to plot the complete dependency graph of an R package and helps to cut down on dependencies.

Installation

<!-- You can install the released version of `depgraph` from [CRAN](https://CRAN.R-project.org) with: ``` r install.packages("depgraph") ``` -->

You can install the development version from GitHub with:

# install.packages("remotes")
remotes::install_github("crsh/depgraph")

Example

Currently, depgraph ships only a single function that plots the dependency graph of an R package based on its DESCRIPTION file. Consider the following example.

library("depgraph")

plot_dependency_graph(
  pkg = multibridge_pkg
  , suggests = FALSE
  , option = "cividis"
)
<div class="figure" style="text-align: center"> <img src="man/figures/README-unnamed-chunk-2-1.png" alt="Dependency graph of a historic development version of the R package `multibridge`." width="100%" /> <p class="caption">

Dependency graph of a historic development version of the R package multibridge.

</p> </div>

Such plots can be used for at least two purposes:

  1. Including dependency graphs in an R package README shows users how many packages their work depends on (indirectly). This is useful as a very rough index of package reliability (less dependencies generally mean less potential for breaking upstream changes) and installation time.
  2. Dependency graphs are useful to identify potential to cut down on dependencies. Briefly, in these graphs you can look for “hot spots” in the network (big bright dots), which represent packages that have many upstream dependencies but are potentially easy to remove because they have few downstream dependencies (that is, only your package depends on them).

Some more details on how to use this graph to reduce package dependencies are given in the package vignette:

vignette("depgraph", package = "depgraph")

Package dependencies

Yeah, I know…:see_no_evil:

plot_dependency_graph(
  pkg = "."
  , suggests = FALSE
  , option = "cividis"
)
<div class="figure" style="text-align: center"> <img src="man/figures/README-unnamed-chunk-3-1.png" alt="Dependency graph of `depgraph`." width="100%" /> <p class="caption">

Dependency graph of depgraph.

</p> </div>

Related Skills

View on GitHub
GitHub Stars43
CategoryDevelopment
Updated7mo ago
Forks3

Languages

R

Security Score

67/100

Audited on Aug 22, 2025

No findings