R Markdown

edge_density(g, loops = F)
## [1] 0.06060606
eigen_centrality(g)$vector
##         3        54       108       152       178       182       214       271 
## 1.0000000 0.3244157 0.2071806 0.2071806 0.2071806 0.2071806 0.2071806 0.2071806 
##       286       300       348       349       371       567       581       584 
## 0.2071806 0.2071806 0.2071806 0.2071806 0.2071806 0.2071806 0.2071806 0.2071806 
##       586       590       604       611      8283        25         6         8 
## 0.2071806 0.2071806 0.2071806 0.2071806 0.2071806 0.5658592 0.1172351 0.1172351 
##        19        23        28        29        30        33        35        50 
## 0.1172351 0.1172351 0.1172351 0.1172351 0.1172351 0.1172351 0.1172351 0.1172351 
##        55        56 
## 0.1172351 0.1172351
E(g)[[inc('54')]]
## + 2/34 edges from 8426c3e (vertex names):
##   tail head tid hid
## 1    3   54   1   2
## 2   54   25   2  22
V(g)$color <- ifelse((V(g)$name =="54"), "red", "white")
plot(g, vertex.label.color = "black")

V(g)$color <- ifelse((V(g)$name =="25"), "pink", "white")
plot(g, vertex.label.color = "black")

Including Plots

You can also embed plots, for example:

## $res
##  [1] 21  2  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1 14  1  1  1
## [26]  1  1  1  1  1  1  1  1  1
## 
## $centralization
## [1] 0.5757576
## 
## $theoretical_max
## [1] 1122

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.