visualise_dependencies: Visualise function dependencies

View source: R/visualise_dependencies.R

visualise_dependenciesR Documentation

Visualise function dependencies

Description

This function creates an interactive visualisation of function dependencies. It can work on functions within a package, or functions loaded into your global environment. Because the underlying functions are a bit weird, the argument syntax isn't quite intuitive. The default behaviour will visualise the function dependencies of what is in your global environment. If you want to visualise the dependencies of a package, you need to pass the prefixed name of a function from that package. Check the examples.

Usage

visualise_dependencies(.f = NULL, ...)

Arguments

.f

(unquoted function name; default = NULL) an unquoted and prefixed function name

...

Arguments passed on to foodwebr::foodweb

FUN

A function.

env

An environment, parent.frame() by default. Ignored if FUN is not NULL.

filter

Boolean. If TRUE, only functions that are direct descendants or antecedents of FUN will be shown.

as.text

Boolean. If TRUE, rather than rendering the graph the intermediate graphviz specification is returned.

Value

a visNetwork object

Examples

## Not run: 

# To visualise the dependencies of your global environment:
sak::load_custom_functions() # You need the functions in the env
visualise_dependencies()

# To visualise the dependencies of a package
# Note if you are in a package repo first run `devtools::load_all()`
# You need to pass the name of a function from the package (any function will
# do)
visualise_dependencies(.f = sak::open_path)

## End(Not run)

baslat/sak documentation built on April 14, 2025, 4:14 p.m.