Learn R Programming

PaRe (version 0.1.16)

pkgDiagram: pkgDiagram

Description

Creates a diagram of all defined functions in a package.

Usage

pkgDiagram(repo, verbose = FALSE, ...)

Value

(htmlwidget)

Diagram htmlwidget object. See createWidget

Arguments

repo

(Repository)
Repository object.

verbose

(logical)
Turn verbose messages on or off.

...

Optional other parameters for grViz.

Examples

Run this code
fetchedRepo <- tryCatch(
  {
    # Set dir to clone repository to.
    tempDir <- tempdir()
    pathToRepo <- file.path(tempDir, "glue")

    # Clone repo
    git2r::clone(
      url = "https://github.com/tidyverse/glue.git",
      local_path = pathToRepo
    )

    # Create instance of Repository object.
    repo <- PaRe::Repository$new(path = pathToRepo)

    # Set fetchedRepo to TRUE if all goes well.
    TRUE
  },
  error = function(e) {
    # Set fetchedRepo to FALSE if an error is encountered.
    FALSE
  },
  warning = function(w) {
    # Set fetchedRepo to FALSE if a warning is encountered.
    FALSE
  }
)

if (fetchedRepo) {
  # Run pkgDiagram on the Repository object.
  pkgDiagram(repo = repo)
}

Run the code above in your browser using DataLab