-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPPSNA_VOS_Graph.r
35 lines (26 loc) · 882 Bytes
/
PPSNA_VOS_Graph.r
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# install.package(readr)
# install.package(quanteda)
# install.package(bibliometrix)
# install.package(igraph)
# install.package(CINNA)
library(readxl)
library(quanteda)
library(igraph)
library(bibliometrix)
library(CINNA)
library(writexl)
comment_nlp <- read_excel("./source/comment_cooc_freq.xlsx")
rn1 <- as.matrix(comment_nlp[,1])
comment_nlp <- comment_nlp[2:497]
#comment_nlp <- comment_nlp[2:13]
row.names(comment_nlp) <- rn1
adjmt <- as.matrix.data.frame(comment_nlp)
#total_occurrences <- colSums(adjmt)
G1 <- graph_from_adjacency_matrix(adjmt, weighted=TRUE, mode="max")
#plot(G1, layout=layout_with_kk)
par(mar=c(1,1,1,1))
net <- networkPlot(adjmt, normalize=NULL, n=vcount(G1), cluster="louvain", type="kamada")
#clusObj <- net[["cluster_obj"]]
#ddf <- data.frame(unlist(clusObj))
#write_xlsx(ddf,"./output/community.xlsx")
net2VOSviewer(net, vos.path = "VOS")