Learn R Programming

RWsearch (version 4.7.0)

n_graph: Graphs of Dependencies

Description

These two functions display in the default browser a network of the package dependencies as a standard graph n_graphF (F for force in networkD3 catalogue) or as a Sankey graph n_graphS. The graphs are built (and can be saved) with the networkD3 package.

Remember that the option p_network(exclpkgs = ... in p_network, whose default value TRUE is equivalent to exclpkgs = c("graphics", "grDevices", "methods", "stats", "tools", "utils"), can substantially modify the aspect of the graph, especially for reverse = FALSE.

Usage

n_graphF(netw, group = 2, fontFamily = "serif", fontSize = 11,
  linkDistance = 50, charge = -100)

n_graphS(netw, group = 2, fontFamily = "serif", fontSize = 14, nodeWidth = 30, nodePadding = 10)

Arguments

netw

a list of class "pkgsnetwork" produced by p_network that describes with nodes and links the dependencies of one or several packages (a network).

group

integer, currently 1, 2 or 3. The suffix of the "NGroup" column in netw. Define a scheme for colouring the nodes.

fontFamily

character. Either "serif" or "sans-serif".

fontSize

integer. The size of the font.

linkDistance

integer. The minimal distance of a link between two nodes.

charge

integer. A repulsive value between two nodes.

nodeWidth

integer. The width of the rectangular nodes in the Sankey graph.

nodePadding

integer. The vertical space between two nodes in the same column of a Sankey graph.

Examples

Run this code
# NOT RUN {
## In real life, download crandb from CRAN or load it from your directory 
## with functions crandb_down() or crandb_load(). 
## In this example, we use a small file.
crandb_load(system.file("data", "zcrandb.rda", package = "RWsearch"))
netw <- p_network(stringr, methods, parallel, stats, utils, reverse = TRUE)
n_graphF(netw)
n_graphS(netw)

n_graphF(p_network(canprot, FatTailsR, actuar, exclpkgs = FALSE))
# }

Run the code above in your browser using DataLab