O'Reilly logo

R Data Analysis Cookbook - Second Edition by Kuntal Ganguly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

To plot social network data using igraph, follow these steps:

  1. Load the data. The following code will restore, from the saved file, a data frame called users.edgelist.upper:
> load("users_edgelist_upper.Rdata") 
  1. The data file that we have provided users.edgelist.upper should now have 1,953 rows of data. Plotting such a network will take too much time--even worse, we will get too dense a plot to get any meaningful information. Just for convenience, we will create a much smaller network by filtering our edge list. We will consider as connected only users who have more than 16 common group memberships and create a far smaller network for illustration only:
> edgelist.filtered <- users.edgelist.upper[users.edgelist.upper$x ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required