_대문 | 방명록 | 최근글 | 홈피소개 | 주인놈
FrontPage › SocialNetworkAnalysis

Contents

[-]
1 edgelist.txt
2 R Source
3 key actors
4 참고자료


1 edgelist.txt #

source	target
2	6
3	6
3	17
4	7
5	7
6	5
7	19
7	23
7	22
8	23
8	12
9	24
9	4
10	6
10	23
11	14
12	17
12	13
12	20
13	3
14	18
14	2
15	21
16	11
16	22
17	11
18	19
19	18
19	24
19	2
19	21
19	25
20	1
20	10
21	19
22	8
22	19
23	9
24	18
24	23
25	7
25	8
25	19
27	26
27	6
26	20
26	6
26	19
26	27

2 R Source #

library("igraph")
edgelist <- read.table("c:\\rdata\\edgelist.txt", header=T)
igraph <- graph.data.frame(edgelist, directed=TRUE)

tkplot(igraph, layout=layout.fruchterman.reingold)

metrics <- data.frame (
  deg = degree(igraph),
  bet = betweenness(igraph),
  clo = closeness(igraph),
  eig = evcent(igraph)$vector,
  cor = graph.coreness(igraph)
  )

res<-as.vector(lm(eig~bet,data=metrics)$residuals)

# install.packages("ggplot2")
library("ggplot2")
ggplot(
  metrics,
  aes(x=bet, y=eig,label=rownames(metrics),colour=res,size=abs(res))) +
  xlab("Betweenness Centrality") +
  ylab("Eigenvector Centrality") +
  geom_text() + 
  ggtitle("Title text")

# actor <- rownames(metrics)
# metrics <- cbind(metrics, actor )

graph.density(igraph)

centralization.evcent(igraph, directed=TRUE)$centralization
centralization.degree(igraph)$centralization
centralization.closeness(igraph)$centralization
centralization.betweenness(igraph)$centralization

3 key actors #

  • degree(number of connections)
  • betweenness(number of shortest paths an actor is on)
  • closeness(relative distance to all other actors)
  • eigenvector centrality(leading eigenvector of sociomatrix)


댓글 남기기..
이름: : 오른쪽의 새로고침을 클릭해 주세요. 새로고침
EditText : Print : Mobile : FindPage : DeletePage : LikePages : Powered by MoniWiki : Last modified 2019-11-22 13:48:28

나는 언제나 활짝 핀 꽃보다는 약속에 찬 봉오리를 소유하는 것보다는 욕망을 완성보다는 진보를 분별 있는 연령보다는 청소년 시절을 사랑한다. (앙드레 지드)