list2graph: Convert a Named List into a Graph Based on Overlap

View source: R/misc.R

list2graphR Documentation

Convert a Named List into a Graph Based on Overlap

Description

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.

Usage

list2graph(nodes)

Arguments

nodes

A named list where each element is a vector.

Value

A data.table representing the graph, with columns for the node names (node_x and node_y) and the weight of the edge (weight).


easybio documentation built on Sept. 17, 2024, 1:08 a.m.