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

Generating projections of a bipartite network

Very often, we need to extract adjacency information about one or both types of nodes in a bipartite network. In the preceding example, with users and groups, we may want to consider two users as related or connected if they have a common group membership and create a graph only of the users. Analogously, we may consider two groups as connected if they have at least one user in common. Use the bipartite.projection function to achieve this:

> # Generate the two projections > p <- bipartite.projection(bg) > p $proj1 IGRAPH UNW- 10 24 -- + attr: name (v/c), weight (e/n) $proj2 IGRAPH UNW- 4 5 -- + attr: name (v/c), weight (e/n) > plot(p$proj1, vertex.size = 20) > plot(p$proj2, vertex.size = 20)  ...

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