Skip to contents

Converts networks to igraph format

Usage

convert2igraph(A, diagonal = 0)

Arguments

A

Matrix or data frame. N x N matrix where N is the number of nodes

diagonal

Numeric. Value to be placed on the diagonal of A. Defaults to 0

Value

Returns a network in the igraph format

Author

Hudson Golino <hfg9s at virginia.edu> & Alexander P. Christensen <alexander.christensen at Vanderbilt.Edu>

Examples

convert2igraph(ega.wmt$network)
#> IGRAPH 97ba7f8 U-W- 18 96 -- 
#> + attr: FALSE (v/c), weight (e/n)
#> + edges from 97ba7f8:
#>  [1]  1-- 2  1-- 3  1-- 4  1-- 5  1--10  1--11  1--16  1--17  2-- 3  2-- 4
#> [11]  2-- 5  2-- 6  2-- 8  2-- 9  2--10  2--14  3-- 4  3-- 6  3-- 7  3-- 8
#> [21]  3--10  3--11  3--12  3--13  3--16  3--18  4-- 5  4-- 6  4-- 7  4-- 8
#> [31]  4-- 9  4--10  4--15  4--17  5-- 6  5-- 7  5-- 8  5--10  5--11  5--12
#> [41]  5--13  5--16  5--17  6-- 7  6-- 8  6-- 9  6--10  6--11  6--12  6--13
#> [51]  6--15  6--16  6--17  7-- 8  7--10  7--11  7--13  7--14  7--15  7--17
#> [61]  8-- 9  8--11  8--12  8--16  8--18  9--10  9--12  9--13  9--14  9--15
#> [71]  9--16 10--11 10--13 10--14 10--16 10--18 11--12 11--15 11--16 11--17
#> + ... omitted several edges