This function creates a graph from a named list, where the edges are determined by the overlap between the elements of the list. Each node in the graph represents an element of the list, and the weight of the edge between two nodes is the number of overlapping elements between the two corresponding lists.
list2graph(nodes)
A data.table representing the graph, with columns for the node names
(node_1
and node_2
) and the weight of the edge (interWeight
).
A named list where each element is a vector.