can't get degree function to work in graph package
2
0
Entering edit mode
Burak Kutlu ▴ 140
@burak-kutlu-3941
Last seen 10.2 years ago
Hello I am trying to call 'degree' on a graphNEL object and I get the following error using the example from the vignette. Thanks for your help -burak > library(graph) > set.seed(123) > g1 = randomEGraph(LETTERS[1:15], edges=100) > g1 A graphNEL graph with undirected edges Number of Nodes = 15 Number of Edges = 100 > > > nodes(g1) [1] "A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" "O" > degree(g1) Error in degree(g1) : Not a graph object > > sessionInfo() R version 2.14.1 (2011-12-22) 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] stats graphics grDevices utils datasets methods base other attached packages: [1] igraph_0.5.5-4 RBGL_1.30.1 org.Mm.eg.db_2.6.4 [4] RSQLite_0.11.1 DBI_0.2-5 AnnotationDbi_1.16.18 [7] Biobase_2.14.0 graph_1.32.0 BiocInstaller_1.2.1 loaded via a namespace (and not attached): [1] IRanges_1.12.6 tools_2.14.1 > [[alternative HTML version deleted]]
graph graph • 2.6k views
ADD COMMENT
0
Entering edit mode
Paul Shannon ▴ 750
@paul-shannon-5161
Last seen 10.2 years ago
Hi Burak, You turned up a very odd bug. And a mysterious one. I just looked at the unit tests for degree, and they do not include exactly the case you used: a graphNEL returned by the randomEGraph method. But degree is successfully called on graphNEL's, and those tests run every day. Puzzling. Could you send me your g1 as an RData object? - Paul On Mar 12, 2012, at 10:29 AM, Burak Kutlu wrote: > Hello > I am trying to call 'degree' on a graphNEL object and I get the following error using the example from the vignette. > Thanks for your help > -burak > >> library(graph) >> set.seed(123) >> g1 = randomEGraph(LETTERS[1:15], edges=100) >> g1 > A graphNEL graph with undirected edges > Number of Nodes = 15 > Number of Edges = 100 >> >> >> nodes(g1) > [1] "A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" "O" >> degree(g1) > Error in degree(g1) : Not a graph object >> >> sessionInfo() > R version 2.14.1 (2011-12-22) > 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] stats graphics grDevices utils datasets methods base > > other attached packages: > [1] igraph_0.5.5-4 RBGL_1.30.1 org.Mm.eg.db_2.6.4 > [4] RSQLite_0.11.1 DBI_0.2-5 AnnotationDbi_1.16.18 > [7] Biobase_2.14.0 graph_1.32.0 BiocInstaller_1.2.1 > > loaded via a namespace (and not attached): > [1] IRanges_1.12.6 tools_2.14.1 >> > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
ADD COMMENT
0
Entering edit mode
Dan Tenenbaum ★ 8.2k
@dan-tenenbaum-4256
Last seen 5 months ago
United States
Hi Burak, On Mon, Mar 12, 2012 at 10:29 AM, Burak Kutlu <bkutlu at="" systemsbiology.org=""> wrote: > Hello > I am trying to call 'degree' on a graphNEL object and I get the following error using the example from the vignette. > Thanks for your help > -burak > >> library(graph) >> set.seed(123) >> g1 = randomEGraph(LETTERS[1:15], edges=100) >> g1 > A graphNEL graph with undirected edges > Number of Nodes = 15 > Number of Edges = 100 >> >> >> nodes(g1) > ?[1] "A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" "O" >> degree(g1) > Error in degree(g1) : Not a graph object >> Looks like you are hitting the degree() function in the igraph package. Try explicitly calling: graph::degree(g1) Dan >> sessionInfo() > R version 2.14.1 (2011-12-22) > 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] stats ? ? graphics ?grDevices utils ? ? datasets ?methods ? base > > other attached packages: > [1] igraph_0.5.5-4 ? ? ? ?RBGL_1.30.1 ? ? ? ? ? org.Mm.eg.db_2.6.4 > [4] RSQLite_0.11.1 ? ? ? ?DBI_0.2-5 ? ? ? ? ? ? AnnotationDbi_1.16.18 > [7] Biobase_2.14.0 ? ? ? ?graph_1.32.0 ? ? ? ? ?BiocInstaller_1.2.1 > > loaded via a namespace (and not attached): > [1] IRanges_1.12.6 tools_2.14.1 >> > ? ? ? ?[[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
ADD COMMENT

Login before adding your answer.

Traffic: 626 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6