[R] Graph visualization

Martin Morgan mtmorgan at fhcrc.org
Fri Sep 11 18:10:13 CEST 2009


Arber Ngjela wrote:
> Hello,
> I am working with graph and adjacency matrix, the package 'graph' seems to be appropriate for this. 
> An example in the package 
>> mat <- rbind(c(0, 0, 1, 1),
> +              c(0, 0, 1, 1),
> +              c(1, 1, 0, 1),
> +              c(1, 1, 1, 0))
>> rownames(mat) <- colnames(mat) <- letters[1:4]
>> graph1 <- new("graphAM", adjMat=mat)
>> graph1
> A graphAM graph with undirected edges
> Number of Nodes = 4 
> Number of Edges = 5 
> 
>  
> how can I plot the object graph1?

Hi Arber

Rgraphviz

 http://bioconductor.org/packages/2.4/bioc/html/Rgraphviz.html

is one option; it can be tricky to install on Windows / Mac where the
version of graphviz installed on your system needs to be the same as the
version used to build the package. See the README file in the package
source distribution

http://bioconductor.org/packages/2.4/bioc/src/contrib/Rgraphviz_1.22.1.tar.gz

Martin

> 
> Thanks in advance
> 
> Arber
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org 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.




More information about the R-help mailing list