Learn R Programming

miniCRAN (version 0.0-16)

plot.pkgDepGraph: Plots a package dependency graph.

Description

Plots a package dependency graph.

Usage

## S3 method for class 'pkgDepGraph':
plot(x, pkgsToHighlight,
  main = "Package dependency graph", legendPosVertex = c(-1, -1),
  legendPosEdge = c(1, -1), shape = "circle", vertex.size = 8, cex = 1,
  ...)

Arguments

x
pkgDepGraph object
pkgsToHighlight
Optional character vector with names of package to hightlight. If missing, defaults to packages used in original call to makeDepGraph
main
Title of plot
legendPosVertex
Numeric vector of length 2, indicating (x, y) position of vertex legend. Both values should be in the range [-1; 1]. If NULL, the vertex legend is not displayed.
legendPosEdge
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.plotting. Could be "none", "circle", "square", ...
vertex.size
Size of vertex shape. See igraph.plotting
cex
Vertex label size.
...
Ignored

See Also

makeDepGraph

Examples

Run this code
tags <- "chron"

# Plot using defaults
dg <- makeDepGraph(tags, includeBasePkgs=FALSE, suggests=TRUE, enhances=TRUE)

set.seed(42); 
plot(dg)

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

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


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

Run the code above in your browser using DataLab