[R] Plotting with Rgraphviz

Martin Morgan mtmorgan at fhcrc.org
Mon Jun 4 15:50:46 CEST 2012


On 06/03/2012 07:38 PM, slipkid90515 wrote:
> Hi All,
>
> After a lengthy battle just to get the package installed, I am not able to
> actually use Rgraphviz to generate any plots.  I tried just using the sample
> code in the documentation
> (http://www2.warwick.ac.uk/fac/sci/moac/people/students/peter_cock/r/rgraphviz/)
> and I get the following:
>
> *>  >  library(Rgraphviz)
>> test.matrix<-matrix(rep(c(0,1,0,0), 9), ncol=6, nrow=6)
>> rownames(test.matrix)<-c("a", "b", "c", "d", "e", "f")
>> colnames(test.matrix)<-c("a", "b", "c", "d", "e", "f")
>> test.matrix
>    a b c d e f
> a 0 0 0 0 0 0
> b 1 0 1 0 1 0
> c 0 0 0 0 0 0
> d 0 1 0 1 0 1
> e 0 0 0 0 0 0
> f 1 0 1 0 1 0
>> am.graph<-new("graphAM", adjMat=test.matrix, edgemode="directed")
>> am.graph
> A graphAM graph with directed edges
> Number of Nodes = 6
> Number of Edges = 9
>> plot(am.graph, attrs = list(node = list(fillcolor = "lightblue"),
> +                                 edge = list(arrowsize=0.5)))
> There were 18 warnings (use warnings() to see them)
>> warnings()
> Warning messages:
> 1: In plot.xy(xy.coords(x, y), type = type, ...) :
>    "len" is not a graphical parameter
> 2: In plot.xy(xy.coords(x, y), type = type, ...) :
>    "edgemode" is not a graphical parameter
> 3: In plot.xy(xy.coords(x, y), type = type, ...) :
>    "len" is not a graphical parameter
> 4: In plot.xy(xy.coords(x, y), type = type, ...) :
>    "edgemode" is not a graphical parameter
> 5: In plot.xy(xy.coords(x, y), type = type, ...) :
>    "len" is not a graphical parameter
> 6: In plot.xy(xy.coords(x, y), type = type, ...) :
>    "edgemode" is not a graphical parameter
> 7: In plot.xy(xy.coords(x, y), type = type, ...) :
>    "len" is not a graphical parameter
> 8: In plot.xy(xy.coords(x, y), type = type, ...) :
>    "edgemode" is not a graphical parameter
> 9: In plot.xy(xy.coords(x, y), type = type, ...) :
>    "len" is not a graphical parameter
> 10: In plot.xy(xy.coords(x, y), type = type, ...) :
>    "edgemode" is not a graphical parameter
> 11: In plot.xy(xy.coords(x, y), type = type, ...) :
>    "len" is not a graphical parameter
> 12: In plot.xy(xy.coords(x, y), type = type, ...) :
>    "edgemode" is not a graphical parameter
> 13: In plot.xy(xy.coords(x, y), type = type, ...) :
>    "len" is not a graphical parameter
> 14: In plot.xy(xy.coords(x, y), type = type, ...) :
>    "edgemode" is not a graphical parameter
> 15: In plot.xy(xy.coords(x, y), type = type, ...) :
>    "len" is not a graphical parameter
> 16: In plot.xy(xy.coords(x, y), type = type, ...) :
>    "edgemode" is not a graphical parameter
> 17: In plot.xy(xy.coords(x, y), type = type, ...) :
>    "len" is not a graphical parameter
> 18: In plot.xy(xy.coords(x, y), type = type, ...) :
>    "edgemode" is not a graphical parameter*
>
>
> Anyone with the same problem?  Any ideas on how to fix?

Hi Jess -- Rgraphviz is a bioconductor package so please ask on that list.

http://bioconductor.org/help/mailing-list/

I don't see those warnings when running your code, maybe you are using 
an older version of R or a mismatch between R  and Rgraphviz versions, 
or have additional packages that have modified plotting functions?

Here's my sessionInfo()

 > sessionInfo()
R version 2.15.0 Patched (2012-05-01 r59304)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
  [7] LC_PAPER=C                 LC_NAME=C
  [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] grid      stats     graphics  grDevices utils     datasets  methods
[8] base

other attached packages:
[1] Rgraphviz_1.34.0 graph_1.34.0

loaded via a namespace (and not attached):
[1] BiocGenerics_0.2.0 stats4_2.15.0      tools_2.15.0

>
> Thanks,
> Jess
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Plotting-with-Rgraphviz-tp4632274.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.


-- 
Computational Biology
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109

Location: M1-B861
Telephone: 206 667-2793



More information about the R-help mailing list