Examine and analyse static function call graphs of R packages. Mostly derived
from functionality provided by the r-lib/pkgapi
package, which is not on CRAN and must first
be installed with
remotes::install_github ("r-lib/pkgapi")
The main function, pg_graph()
, returns all exported and non-exported
functions from a package (as nodes
), and tallies of all functional
connections between these (as edges
). The function also includes a plot
parameter which can be used to visualize the resultant network using the
visNetwork
package.
library (packgraph) if (!file.exists ("./git2r")) git2r::clone ("https://github.com/ropensci/git2r", local_path = "./git2r") # Currently needs absolute file paths to work pkg_dir <- tools::file_path_as_absolute ("./git2r") g <- pg_graph (pkg_dir, plot = FALSE) g
pkgapi
package.flow
package produces flow diagrams of R functions.collaboratoR
package as
presented at eRum
2020
extracts graphs of collaborators from a version control history rather than
graphs of functions.Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.