[BioC] can't get degree function to work in graph package
Dan Tenenbaum
dtenenba at fhcrc.org
Wed Mar 14 05:34:36 CET 2012
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
More information about the Bioconductor
mailing list