| pkg_graph | R Documentation |
Discovers R packages under scan_dir via projects,
parses each one's Depends and Imports fields, and
renders edges between packages that both live in scan_dir.
External CRAN dependencies are dropped.
pkg_graph(
scan_dir = path.expand("~"),
packages = NULL,
include_suggests = FALSE,
...
)
scan_dir |
Directory to scan for project directories. |
packages |
Optional character vector limiting the graph to these packages. |
include_suggests |
If |
... |
Passed through to |
Character vector of SVG lines. Write with writeLines().
d <- file.path(tempdir(), "pkgdemo")
dir.create(file.path(d, "parent"), recursive = TRUE, showWarnings = FALSE)
dir.create(file.path(d, "child"), showWarnings = FALSE)
writeLines(c("Package: parent", "Title: P", "Version: 0.1.0"),
file.path(d, "parent", "DESCRIPTION"))
writeLines(c("Package: child", "Title: C", "Version: 0.1.0",
"Imports: parent"),
file.path(d, "child", "DESCRIPTION"))
svg <- pkg_graph(scan_dir = d)
writeLines(svg, tempfile(fileext = ".svg"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.