| plotPaths {tsna} | R Documentation | 
Network Plots a Highlighting Temporal Path(s) .
Description
Wrapper for plot.network with appropriate defaults to plot a highlighted path, or over-plot highlighted paths on a on top of a static aggregate network plot. 
Usage
plotPaths(nd, paths,  path.col = rainbow(length(paths), alpha = 0.5), 
           displaylabels = TRUE, coord=NULL, ...)
           
## S3 method for class 'tPath'
plot(x, edge.col = "red", 
              edge.label.col = edge.col, 
              edge.lwd = 10, 
              edge.label.cex = 0.7, 
              displaylabels = TRUE, 
              displayisolates = FALSE, 
              jitter = FALSE, 
              vertex.lwd = (x$gsteps == 0) * 4 + 1, 
              vertex.cex = (x$gsteps == 0) * 1.5, 
              vertex.col = NA, ...) 
Arguments
| nd | a  | 
| paths | a  | 
| path.col | vector of valid colors (possibly transparent) to be used for each path. Default will created semi-transparent colors from the rainbow palette. | 
| x | object (assumed to be  | 
| ... | additional arguments to be passed to  | 
| coord | optional numeric matrix of coordinates for positioning vertices. See  | 
| edge.col | color for drawing edges (paths). See  | 
| edge.label.col | color for edge labels. Default to same color as edges. See  | 
| edge.lwd | numeric expansion factor for edge line widths. See  | 
| edge.label.cex | numeric expansion factor for edge labels. See  | 
| displaylabels | logical, should vertex labels be included on the plot? See  | 
| displayisolates | logical, should isolated vertices be included in the plot? See  | 
| jitter | adds random noise to positions (disabled by default) See  | 
| vertex.lwd | Vertex border line with. See  | 
| vertex.cex | Vertex expansion factor. Default is to scale up the origin vertex for the path, and not draw the other vertices. See  | 
| vertex.col | Color for vertices. Default is to leave them un-colored. See  | 
Details
plotPaths plots the networkDynamic object using the normal plot.network function and ... arguments.  Then calls plot.tPath for each tPath object in paths to over-plot the edges of path onto the network plot using the corresponding path.col color.  Use of semi-transparent colors can help (somewhat) improve readability when paths overlap on the same edges.  
plot.tPath plots the path information encoded in a single tPath object.  It first creates a network using as.network.tPath and then calls plot.network  with suitable defaults for drawing (or over-drawing) the path (doesn't display isolated vertices, draws times as edge labels, draws a color around the source vertex, etc. )
Value
Generates a network plot with a highlighted path, invisibly returns the plot coordinates.
Author(s)
skyebend
See Also
See also tPath
Examples
data(moodyContactSim)
v10path<-tPath(moodyContactSim,v=10,start=0)
# plot just the path from v10
plot(v10path)
# plot the path from v10 on top of the network
plotPaths(moodyContactSim,v10path)
# plot the paths from both v10 and v1
v1path<-tPath(moodyContactSim,v=1,start=0)
plotPaths(moodyContactSim,list(v10path,v1path))
# if ndtv package is installed, along with Graphviz system library,
# nice hierarchical trees can be drawn
## Not run: 
plot(v10path,
     coord=network.layout.animate.Graphviz(
                   as.network(v10path),
                   layout.par = list(gv.engine='dot')
            ),
            jitter=FALSE
    )
## End(Not run)