Function to convert igraph graph to a list suitable for networkD3

igraph_to_networkD3(g, group, what = "both")

Arguments

g

an igraph class graph object

group

an object that contains node group values, for example, those created with igraph's membership function.

what

a character string specifying what to return. If what = 'links' or what = 'nodes' only the links or nodes are returned as data frames, respectively. If what = 'both' then both data frames will be return in a list.

Value

A list of link and node data frames or only the link or node data frames.