Making use of the igraph package to draw a network

The igraph package is a reference point for network visualization in the R environment.

igraph is actually more than an R package, since you can use igraph tools even with Python and C/C++.

If you are performing analysis that involves network visualizations and R, you should look at this package as one of your more relevant allies.

This recipe will let you enter the wide world of network visualization with R, showing you how to create a network plot starting from a data frame.

Getting ready

Install the igraph package:


We will use the flo dataset showing the relationship between Renaissance Florentine families.

Marriage between Adimari and Cascioni families, ...

Get RStudio for R Statistical Computing Cookbook now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.