Original link:tecdat.cn/?p=18770 

Original source:Tuo End number according to the tribe public number

 

To process network data with R, we use the wedding data set.


> nflo=network(flo,directed=FALSE)
> plot(nflo, displaylabels = TRUE,
+ boxed.labels =
+ FALSE)
Copy the code

 

The next step is igraph. Since we have an adjacency matrix, we can use it


graph_from_adjacency_matrix(flo,
+ mode = "undirected")
Copy the code

 

We can get the shortest path between two specific nodes. We give the nodes the appropriate color

 all_shortest_paths(iflo,
 )
 
 
> plot(iflo)
Copy the code

 

We can also visualize edges that need to be extracted from the output

> lins=c(paste(as.character(L)[1:4],
+ "--" 
+ as.character(L)[2:5]  sep="" ,
+ paste(as.character(L) 2:5],
+ "--",
 
> E(ifl )$color=c("grey","black")[1+EU]
> plot(iflo)
Copy the code

 

D3js visualization can also be used

> library( networkD3 )
> simpleNetwork (df)
Copy the code

 

The next problem is to add a vertex to the network. The simplest way is to implement the probability through an adjacency matrix


> flo2["f","v"]=1
> flo2["v","f"]=1
Copy the code

 

Then, we measure concentration.

 

The goal is to understand the relationship between them.

Betweenness (ILO) > Cor (base) betw close deg eig betw 1.0000000 0.5763487 0.8333763 0.6737162 close 0.5763487 1.0000000 0.7572778 0.7989789 DEG 0.8333763 0.7572778 1.0000000 0.9404647 EIG 0.6737162 0.7989789 0.9404647 1.0000000Copy the code

A hierarchical cluster diagram can be used to visualize concentration measures

hclust(dist( ase  ,
+ method="ward")
Copy the code

 

View the value of the concentration measure, and view the ranking

 
> for(i in 1:4) rbase[,i]=rank(base[,i])
 
Copy the code

 

Here, the eigenvector measures are very close to the degree of the vertices.

Finally, look for clusters (in case war breaks out between these families)

> kc <- fastgreedy.community ( iflo )
Copy the code

In this case, we have 3 categories

 

 


Most welcome insight

1. All acupoints were analyzed by WEB complex network of SPS-Modeler

2. Community detection in social networks using R language and Python

3.R language text mining NASA data Network analysis, TF-IDF and topic modeling

4. Epidemic modeling using airline complex networks in R language

5. Python membership graph model Detection of dense overlapping communities in model-based networks

6. Analyze social networks using Python and SAS Viya

7. Association network analysis: Data portraits of migrants who have moved out of Beijing

8. Emotional Semantic network: Travel data perception of tourist destination image

9. Use association rule data mining to explore the rules of drug compatibility