Download presentation
Presentation is loading. Please wait.
Published byIan McMillan Modified over 11 years ago
1
Lightning talk to Boston area R users group Jeff Marcus 7/13/2011
Rgraphviz Lightning talk to Boston area R users group Jeff Marcus 7/13/2011
2
Introduction Rgraphviz allows you to visualize graphs (nodes and arcs)
Good detailed presentation at Some applications Social networks Biological pathways, protein interactions My use: callflow analysis in speech recognition applications Rgraphviz part of Bioconductor project Built around Graphviz, AT&T opensource graph visualization software
3
Example using “graph” package
library(“graph”) library(“Rgraphviz”) nodes <- c("A", "B", "C", "D") edge.list <- list( A=list(edges=c("A", "B", "C")), B=list(edges=("C")), C=list(edges=c(“C","D")), D=list(edges=“B")) g <- new("graphNEL", nodes=nodes, edgeL=edge.list, edgemode="directed") Rgraphviz::plot(g) Note: graphNEL is a class in the “graph” package that extends virtual “graph” class. Efficient for smallish graphs with not too many edges
4
Igraph package Package “igraph” has richer set of graph manipulation functions and is better suited to large graphs Must convert igraph to graphNEL for Rgraphviz library(“igraph”) # igraph has many ways to construct graphs ig <- igraph::graph.data.frame (data.frame( from=c("a","a","a","b", "c", "c", "d"), to=c("a","b","c","c", "c", "d", "b"))) g <- igraph.to.graphNEL (ig) # Same graph as before Rgraphviz::plot(g)
5
Rgraphviz layout control
Very fine-grained control of layout Overall layout (“dot”, “neato”, etc., each useful for different purposes) Node shapes Node and edge colors Edge thicknesses Ability to plot subgraphs as well Rgraphviz essentially an API around graphviz so need to consult graphviz documentation for details Caution: I found that many but not all graphviz features supported
6
Example: callflow graph
Rgraphviz can produce legible graphs much more complex than this one
7
Installation You will need to first install graphviz
See for details for Windows installation.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.