1

I have the fblog data set that is about french political party blogs.and is an object of igraph I just want to plot the most represented party(node) in my the set I used degree as below, but now I dont know how to use it to plot it I want just to show 20 of most important party(nodes) in my graph and plot them. I hope you can help me

 deg_g <-sort(igraph::degree(fblog, mode = "all", normalized = T),decreasing = TRUE)
class(deg_g)
UU<-deg_g[1:20]

G5W
  • 36,531
  • 10
  • 47
  • 80
eli
  • 184
  • 2
  • 12

1 Answers1

1

In order to get the subgraph, you need to know which nodes have the highest degree, not what their degree is. Once you have that, you can just use induced_subgraph.

library(igraph)
library(sand)
data(fblog)
fblog = upgrade_graph(fblog)

DEG <-order(igraph::degree(fblog, mode = "all", normalized = T),
             decreasing = TRUE)

HighDeg = induced_subgraph(fblog, DEG[1:20])
plot(HighDeg)

Subgraph of nodes with high degree

I am sure that you can layout the graph to make it prettier, but this is the subgraph that you requested.

G5W
  • 36,531
  • 10
  • 47
  • 80