dep_graph | R Documentation |
Create a dependency graph between a set of R packages and plot them
as an interactive network. By default,
plots only packages within the
echoverse
.
dep_graph(
pkg,
exclude = NULL,
method_seed = c("pkgnet", "github", "devtools"),
shape = c("image", "hexagon"),
image = "hex_sticker",
layout = layout_igraph,
colors = construct_colors(),
node_size = NULL,
font_face = "Tahoma",
show_plot = list(r = FALSE, browser = TRUE),
save_path = file.path(tempdir(), paste0(basename(pkg), ".dep_graph.html")),
width = "100%",
height = "90vh",
reverse = FALSE,
recursive = FALSE,
use_basename = TRUE,
add_metadata = TRUE,
verbose = TRUE
)
pkg |
Package to search dependencies for. |
exclude |
A subset of of the main package's ( |
method_seed |
Method to create the initial dependency graph with:
If more than one option is provided, only the first is used. |
shape |
: String. Default to 'ellipse'. The shape defines what the node looks like. There are two types of nodes. One type has the label inside of it and the other type has the label underneath it. The types with the label inside of it are: ellipse, circle, database, box, text. The ones with the label outside of it are: image, circularImage, diamond, dot, star, triangle, triangleDown, hexagon, square and icon. |
image |
: List or String. Default to undefined. When the shape is set to image or circularImage, this option should be the URL to an image. If the image cannot be found, the brokenImage option can be used.
|
layout |
visNetwork layout function
(e.g. visLayout or visIgraphLayout
to specify plot layout. The function must take two arguments:
"graph" and "pkg".
See |
colors |
Colors for each of the graph plot elements. Can use the construct_colors function to help create this. |
node_size |
Strategy for setting node sizes. Can be one of:
|
font_face |
Font to use for plot text. |
show_plot |
A named list with two items:
|
save_path |
Path to save the plot to, as an interactive, self-container HTML file. |
width |
: String. Default to "100%". The width of the network in pixels or as a percentage. |
height |
: String. Default to "100%". The height of the network in pixels or as a percentage. |
reverse |
|
recursive |
If |
use_basename |
Only use the repo name to label each node. |
add_metadata |
Add metadata to the graph using github_metadata. |
verbose |
Print messages. |
## Not run:
#### not run simply bc it causes weird errors with devtools::check() ####
res <- dep_graph(pkg = "echoverse",
layout=layout_star)
## End(Not run)
res <- dep_graph(pkg = "rworkflows",
method_seed = "github",
reverse = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.