igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] Output from degree


From: Thomas
Subject: [igraph] Output from degree
Date: Wed, 12 Mar 2014 08:19:22 +0000

Can anyone please explain why this is happening? With two different graphs, the output format from degree() is different. I'd like to force the second format (output just one number) on the first graph.

Thank you,

Thomas Chesney

i <- 5

g <- read.table("/Users/thomas/Documents/Datasets/organizations/ S1Anonymized.csv",header=FALSE, sep=",", na.strings="NA", dec=".", strip.white=TRUE)
g <- graph.data.frame(g, directed=FALSE, vertices=NULL)

degree(g,i)
69
 1

f <- watts.strogatz.game(1, 165, 5, 0.05)
degree(f,i)
[1] 8

str(degree(g,i))
 Named num 1
 - attr(*, "names")= chr "69"

str(degree(f,i))
 num 8

I'm using R:

> sessionInfo()
R version 2.15.3 (2013-03-01)
Platform: i386-apple-darwin9.8.0/i386 (32-bit)

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

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

other attached packages:
[1] igraph_0.6.5-1

loaded via a namespace (and not attached):
[1] tools_2.15.3

This message and any attachment are intended solely for the addressee and may 
contain confidential information. If you have received this message in error, 
please send it back to me, and immediately delete it.   Please do not use, copy 
or disclose the information contained in this message or in any attachment.  
Any views or opinions expressed by the author of this email do not necessarily 
reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system, you 
are advised to perform your own checks. Email communications with the 
University of Nottingham may be monitored as permitted by UK legislation.







reply via email to

[Prev in Thread] Current Thread [Next in Thread]