| Type: | Package |
| Title: | Statically Determine Function Dependencies Between Packages |
| Version: | 1.1.1 |
| Maintainer: | Ed Peyton <edppeyton@gmail.com> |
| 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. |
| License: | MIT + file LICENSE |
| URL: | https://pkgdepR.org/ |
| BugReports: | https://github.com/edpeyton/pkgdepR/issues |
| Encoding: | UTF-8 |
| RoxygenNote: | 7.3.2 |
| Imports: | visNetwork, dplyr, magrittr, viridisLite, scales, utils |
| NeedsCompilation: | no |
| Packaged: | 2024-11-19 07:09:19 UTC; User |
| Author: | Ed Peyton |
| Repository: | CRAN |
| Date/Publication: | 2024-11-19 07:50:02 UTC |
pkgdepR: 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.
Details
The only function you're likely to need from pkgdepR is deps, which returns an object of class pkgdepR.
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, andname.linksa data frame containing the linkages between functions. Contains columns
fromandto.pkga character vector containing the packages explored.
Author(s)
Maintainer: Ed Peyton edppeyton@gmail.com (ORCID)
See Also
Useful links:
Report bugs at https://github.com/edpeyton/pkgdepR/issues
Imported magrittr forward-pipe operator
Description
Imported from magrittr.
Get all information on a namespace
Description
Get all information on a namespace
Usage
all_info_ns(ns)
Arguments
ns |
A character representing the namespace to explore. |
Value
A named list.
Get environment dependency object
Description
This function creates an object of class pkgdepR, representing the network of function calls between one or more packages.
Usage
deps(pkg, exported_only = FALSE)
Arguments
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. |
Details
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, andname.linksa data frame containing the linkages between functions. Contains columns
fromandto.pkga character vector containing the packages explored.
Value
An object of class pkgdepR.
Examples
library(pkgdepR)
deps(pkg = "pkgdepR")
Get functions from namespace
Description
Get functions from namespace
Usage
get_functions(ns)
Arguments
ns |
A character representing the namespace to explore. |
Value
A character vector of function names.
pkgdepR object
Description
An internal generic function. Methods for is.pkgdepR should only return TRUE if the class is pkgdepR.
Usage
is.pkgdepR(x)
Arguments
x |
Object to be tested. |
Value
Boolean. TRUE when x is of class pkgdepR.
Get namespace information
Description
Get namespace information
Usage
ls_namespace_info(ns, ...)
Arguments
ns |
A character representing the namespace to explore. |
... |
Other arguments passed to ls. |
Value
A character vector of the names to search for a given namespace.
Visualizing package dependencies
Description
This function is a simple wrapper for plotting a network visualization using visNetwork.
Usage
## 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,
...
)
Arguments
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. |
Value
An object of classes visNetwork and htmlwidget.
Examples
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
Description
Print pkgdepR object
Usage
## S3 method for class 'pkgdepR'
print(x, ...)
Arguments
x |
An object of class |
... |
Redundant argument for consistency with method. |
Value
No return value.
Summarise pkgdepR object
Description
Summarise pkgdepR object
Usage
## S3 method for class 'pkgdepR'
summary(object, ...)
Arguments
object |
An object of class |
... |
Redundant argument for consistency with method. |
Value
No return value.