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/DepgraphREADME
depgraph: Plot the complete dependency graph of an R package
<!-- badges: start --> <!-- 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.
Such plots can be used for at least two purposes:
- Including dependency graphs in an R package
READMEshows 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. - 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.
Related Skills
node-connect
343.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
90.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
