| Title: | Statically Determine Function Dependencies Between Packages |
|---|---|
| Description: | Statically determine and visualize the function dependencies within and across packages. This may be useful for managing function dependencies across a code base of multiple R packages. |
| Authors: | Ed Peyton [aut, cre] (ORCID: <https://orcid.org/0000-0002-1427-0306>) |
| Maintainer: | Ed Peyton <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.1.1 |
| Built: | 2026-06-03 07:41:23 UTC |
| Source: | https://github.com/edpeyton/pkgdepr |
Get all information on a namespace
all_info_ns(ns)all_info_ns(ns)
ns |
A character representing the namespace to explore. |
A named list.
This function creates an object of class pkgdepR, representing the network of function calls between one or more packages.
deps(pkg, exported_only = FALSE)deps(pkg, exported_only = FALSE)
pkg |
A character vector of the environments to explore. Should be on the search path. Cannot be |
exported_only |
Boolean. Whether to include non-exported functions. |
An object of class pkgdepR is a list with three named objects:
funsa data frame describing the functions. Contains columns id, label, package, exported, group, and name.
linksa data frame containing the linkages between functions. Contains columns from and to.
pkga character vector containing the packages explored.
An object of class pkgdepR.
library(pkgdepR) deps(pkg = "pkgdepR")library(pkgdepR) deps(pkg = "pkgdepR")
Get functions from namespace
get_functions(ns)get_functions(ns)
ns |
A character representing the namespace to explore. |
A character vector of function names.
An internal generic function. Methods for is.pkgdepR should only return TRUE if the class is pkgdepR.
is.pkgdepR(x)is.pkgdepR(x)
x |
Object to be tested. |
Boolean. TRUE when x is of class pkgdepR.
Get namespace information
ls_namespace_info(ns, ...)ls_namespace_info(ns, ...)
ns |
A character representing the namespace to explore. |
... |
Other arguments passed to ls. |
A character vector of the names to search for a given namespace.
This function is a simple wrapper for plotting a network visualization using visNetwork.
## S3 method for class 'pkgdepR' plot( x, width = NULL, height = NULL, main = NULL, submain = NULL, alpha = 0.8, footer = NULL, background = "rgba(0, 0, 0, 0)", n, m, ... )## S3 method for class 'pkgdepR' plot( x, width = NULL, height = NULL, main = NULL, submain = NULL, alpha = 0.8, footer = NULL, background = "rgba(0, 0, 0, 0)", n, m, ... )
x |
An object of class |
width |
The width of the |
height |
The height of the |
main |
The title. To remove the title, pass |
submain |
The subtitle. To remove the subtitle, pass |
alpha |
A transparency value to use for colors. Must be between 0 and 1. |
footer |
A character or a named list. See visNetwork. |
background |
A background color. See visNetwork. |
n |
(Optional) The number of colours to request from viridis. Allows the user to set a more granular palette. |
m |
(Optional) The subset of colours of the custom palette (specified by |
... |
Other arguments passed onto viridis. |
An object of classes visNetwork and htmlwidget.
library(pkgdepR) deps(pkg = "pkgdepR") %>% plot(option = "E", direction = -1) deps(pkg = "pkgdepR") %>% plot(option = "D", alpha = 0.5, main = list(text = NULL)) deps(pkg = "pkgdepR") %>% plot(option = "D", alpha = 0.8, main = list(text = NULL)) %>% visNetwork::visInteraction(dragNodes = FALSE)library(pkgdepR) deps(pkg = "pkgdepR") %>% plot(option = "E", direction = -1) deps(pkg = "pkgdepR") %>% plot(option = "D", alpha = 0.5, main = list(text = NULL)) deps(pkg = "pkgdepR") %>% plot(option = "D", alpha = 0.8, main = list(text = NULL)) %>% visNetwork::visInteraction(dragNodes = FALSE)
Print pkgdepR object
## S3 method for class 'pkgdepR' print(x, ...)## S3 method for class 'pkgdepR' print(x, ...)
x |
An object of class |
... |
Redundant argument for consistency with method. |
No return value.
Summarise a 'pkgdepR' object
## S3 method for class 'pkgdepR' summary(object, ...)## S3 method for class 'pkgdepR' summary(object, ...)
object |
An object of class |
... |
Redundant argument for consistency with method. |
No return value.