How to build a relationship in R?

The ratio is expressed as a matrix x as follows:

  John Jack Mary Wendy John 0 2 1 1 Jack 2 0 1 0 Mary 1 1 0 1 Wendy 1 0 1 0 

Entries refer to the number of connections they have. Can someone show me how to build it as a network in R? Thanks!

+2
source share
1 answer

This is called an adjacency matrix.

The R FAQ has information on building social networks, expressed as matrices:

Building data on a social network can be easily done using the igraph package in R. [...] In order for the igraph package to recognize this table as a network, we can first convert it to a matrix. Then, if we want to calculate the statistical data related to it by graphs (among themselves, proximity, degree), we can use the matrix to create a graph object.

Frequently asked questions give some examples leading to sociogram diagrams, for example:

enter image description here

The igraph library igraph documented here - it can create much more complex examples - see the screenshot page and example below:

enter image description here

+7
source

All Articles