Hey, all. I'm looking for packages that are good at two things 1) Drawing directed graphs (i.e nodes and edges), both with single and double headed arrows, as well as allowing for differences in line width and solid versus dashed. Note: I've tried Rgraphviz here, but have run into some problems (which seem fixable and I may go with it in the end), and it doesn't satisfy need # 2 (which would be ideal if there is a package that does both). 2) Allowing a user to create a directed graph, and have some text object created that can be reprocessed easily reprocessed into a matrix representation, or other representation of my choosing. I've tried dynamicGraph, but it seems buggy, and continually either crashes, behaves very erratically (nodes disappearing when I modify edges), nor is it clear from the UI how one outputs a new graph, nor how one even accesses many graph attributes. This may be my own ignorance on the latter. Do you have any suggestions? Thanks! -Jarrett -------------------------------------------------------------- A Quick and (Very) Dirty Guide to Stats in R http://didemnid.ucdavis.edu/rtutorial.html [[alternative HTML version deleted]]
Also try gplot in the sna package to see if it does what you want. Here are some examples from the r-help archives: http://finzi.psych.upenn.edu/R/Rhelp02a/archive/87003.html http://finzi.psych.upenn.edu/R/Rhelp02a/archive/84442.html On 2/13/07, Jarrett Byrnes <jebyrnes at ucdavis.edu> wrote:> Hey, all. I'm looking for packages that are good at two things > > 1) Drawing directed graphs (i.e nodes and edges), both with single > and double headed arrows, as well as allowing for differences in line > width and solid versus dashed. Note: I've tried Rgraphviz here, but > have run into some problems (which seem fixable and I may go with it > in the end), and it doesn't satisfy need # 2 (which would be ideal if > there is a package that does both). > > 2) Allowing a user to create a directed graph, and have some text > object created that can be reprocessed easily reprocessed into a > matrix representation, or other representation of my choosing. I've > tried dynamicGraph, but it seems buggy, and continually either > crashes, behaves very erratically (nodes disappearing when I modify > edges), nor is it clear from the UI how one outputs a new graph, nor > how one even accesses many graph attributes. This may be my own > ignorance on the latter. > > Do you have any suggestions? > > Thanks! > > -Jarrett > > > > > -------------------------------------------------------------- > A Quick and (Very) Dirty Guide to Stats in R > http://didemnid.ucdavis.edu/rtutorial.html > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
Jarrett, check the gplot function in package SNA and the plot.igraph and tkplot functions in package 'igraph'. SNA's gplot is more flexible, it knows different shapes, edges can be curved, etc, tkplot is interactive if you desire that. It is also easy to convert between the two graph representations of the two packages, see the graph.adjacency and get.adjacency function in igraph. Gabor On Tue, Feb 13, 2007 at 10:11:04AM -0800, Jarrett Byrnes wrote:> Hey, all. I'm looking for packages that are good at two things > > 1) Drawing directed graphs (i.e nodes and edges), both with single > and double headed arrows, as well as allowing for differences in line > width and solid versus dashed. Note: I've tried Rgraphviz here, but > have run into some problems (which seem fixable and I may go with it > in the end), and it doesn't satisfy need # 2 (which would be ideal if > there is a package that does both). > > 2) Allowing a user to create a directed graph, and have some text > object created that can be reprocessed easily reprocessed into a > matrix representation, or other representation of my choosing. I've > tried dynamicGraph, but it seems buggy, and continually either > crashes, behaves very erratically (nodes disappearing when I modify > edges), nor is it clear from the UI how one outputs a new graph, nor > how one even accesses many graph attributes. This may be my own > ignorance on the latter. > > Do you have any suggestions? > > Thanks! > > -Jarrett > > > > > -------------------------------------------------------------- > A Quick and (Very) Dirty Guide to Stats in R > http://didemnid.ucdavis.edu/rtutorial.html > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Csardi Gabor <csardi at rmki.kfki.hu> MTA RMKI, ELTE TTK
You might also want to look at the network package, which includes a plot method for network objects that is pretty flexible. It also enables you to convert a network object into various different matrix reprentations. On 13/02/07, Jarrett Byrnes <jebyrnes at ucdavis.edu> wrote:> Hey, all. I'm looking for packages that are good at two things > > 1) Drawing directed graphs (i.e nodes and edges), both with single > and double headed arrows, as well as allowing for differences in line > width and solid versus dashed. Note: I've tried Rgraphviz here, but > have run into some problems (which seem fixable and I may go with it > in the end), and it doesn't satisfy need # 2 (which would be ideal if > there is a package that does both). > > 2) Allowing a user to create a directed graph, and have some text > object created that can be reprocessed easily reprocessed into a > matrix representation, or other representation of my choosing. I've > tried dynamicGraph, but it seems buggy, and continually either > crashes, behaves very erratically (nodes disappearing when I modify > edges), nor is it clear from the UI how one outputs a new graph, nor > how one even accesses many graph attributes. This may be my own > ignorance on the latter. > > Do you have any suggestions? > > Thanks! > > -Jarrett > > > > > -------------------------------------------------------------- > A Quick and (Very) Dirty Guide to Stats in R > http://didemnid.ucdavis.edu/rtutorial.html > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- ================================David Barron Said Business School University of Oxford Park End Street Oxford OX1 1HP
Hi Jarrett, would the coercion methods for the "graph" class, provided by the package of the same name at Bioconductor be useful for doing what you want? This is the same class that also Rgraphviz works on. Try library("graph") example("graphNEL-class") as(gR, "matrix") class ? graph class ? graphNEL ? toGXL There is a rich sets of methods for setting and accessing node and edge attributes, and it is straightforward R to convert into any other representation you like. See the vignette "Attributes for Graph Objects". I am looking at version >= 1.13.6 of the package as I write this, Best wishes -- ------------------------------------------------------------------ Wolfgang Huber EBI/EMBL Cambridge UK http://www.ebi.ac.uk/huber> Hey, all. I'm looking for packages that are good at two things > > 1) Drawing directed graphs (i.e nodes and edges), both with single > and double headed arrows, as well as allowing for differences in line > width and solid versus dashed. Note: I've tried Rgraphviz here, but > have run into some problems (which seem fixable and I may go with it > in the end), and it doesn't satisfy need # 2 (which would be ideal if > there is a package that does both). > > 2) Allowing a user to create a directed graph, and have some text > object created that can be reprocessed easily reprocessed into a > matrix representation, or other representation of my choosing. I've > tried dynamicGraph, but it seems buggy, and continually either > crashes, behaves very erratically (nodes disappearing when I modify > edges), nor is it clear from the UI how one outputs a new graph, nor > how one even accesses many graph attributes. This may be my own > ignorance on the latter. > > Do you have any suggestions? > > Thanks! > > -Jarrett > >