plot.pkgDepGraph: Plots a package dependency graph.

Description Usage Arguments See Also Examples

View source: R/plot.pkgDepGraph.R

Description

Plots a package dependency graph.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## S3 method for class 'pkgDepGraph'
plot(
  x,
  pkgsToHighlight,
  main = paste(attr(x, "pkgs"), collapse = ", "),
  legendPosition = c(-1.2, -1),
  shape = "circle",
  vertex.size = 8,
  cex = 1,
  ...
)

Arguments

x

Object to plot

pkgsToHighlight

Optional character vector with names of package to highlight. If missing, defaults to packages used in original call to makeDepGraph()

main

Title of plot

legendPosition

Numeric vector of length 2, indicating (x, y) position of edge legend. Both values should be in the range [-1; 1]. If NULL, the edge legend is not displayed.

shape

Shape of edge. See igraph::igraph.plotting(). Could be "none", "circle", "square", ...

vertex.size

Size of vertex shape. igraph::igraph.plotting()

cex

Vertex label size.

...

Ignored

See Also

Other dependency functions: basePkgs(), makeDepGraph(), pkgDep()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
tags <- "chron"

# Plot using defaults
pdb <- cranJuly2014

## Not run: 
  pdb <- pkgAvail(
    repos = c(CRAN = getOption("minicran.mran")),
    type = "source"
  )

## End(Not run)

dg <- makeDepGraph(tags, availPkgs = pdb  , includeBasePkgs = FALSE,
                   suggests = TRUE, enhances = TRUE)

set.seed(42);
plot(dg)

# Move edge legend to top left
set.seed(42);
plot(dg, legendPosition = c(-1, 1))

# Change font size and shape size
set.seed(42);
plot(dg, legendPosition = c(-1, 1), vertex.size = 20,  cex = 0.5)


# Move vertex legend to top right
set.seed(42);
plot(dg, legendPosition = c(1, 1), vertex.size = 20,  cex = 0.5)

miniCRAN documentation built on Sept. 16, 2020, 1:07 a.m.