Fix the intermediate input from sna::cug.test

fix_cug_input(el, directed = TRUE)

Arguments

el

the input generated by a single run of sna::cug.test

directed

logical, is the graph directed or not?

Value

object of class igraph

Details

This function makes the cug.test useable for snafun. The cug.test function generates a series of networks in a various specific ways. This function converts that data format into an object of class igraph, which can then be handled by (almost) any function in snafun or igraph or other code that works with igraph objects.

This somwtimes slows down the computations in cug.test a little, but can sometimes also speed it up. Either way, the added flexibility is a huge gain.

Make sure to set correctly whether the actual graph is directed or not.