Learn R Programming

pkgGraphR (version 0.3.1)

plotPackageGraph: Plot a graph or diagram of a package

Description

From a list of nodes and edges, plots a diagram or graph

Usage

plotPackageGraph(graph, fun.list, use.subgraphs = FALSE, use.colors = FALSE)

Value

A grviz plot.

Arguments

graph

A list generated by buildPackageGraph containing edges and nodes of the graph.

fun.list

An optional list generated by collectFunNames containing each files function assignments. Used only if `use.subgraphs` or `use.colors` are true

use.subgraphs

Logical indicating whether the graph should be partitioned into subgraphs by the file in which the function assignment was made. DEFAULT: FALSE

use.colors

Logical indicating whether the nodes of the graph should be colored by the file in which the function assignment was made. N.B. No legend is plotted for the colors. DEFAULT: FALSE

See Also

collectFunNames, buildPackageGraph

Examples

Run this code
pkgGraph <- system.file("extdata", package = "pkgGraphR") |>
    buildPackageGraph()
plotPackageGraph(graph = pkgGraph)

pkgFuns <- system.file("extdata", package = "pkgGraphR") |>
    collectFunNames()

plotPackageGraph(graph = pkgGraph, fun.list = pkgFuns, use.subgraphs = TRUE)
plotPackageGraph(graph = pkgGraph, fun.list = pkgFuns, use.colors = TRUE)
plotPackageGraph(graph = pkgGraph, fun.list = pkgFuns, use.colors = TRUE, use.subgraphs = TRUE)

Run the code above in your browser using DataLab