Assign Vertex and Edge Attributes to an igraph Graph
assign_attributes.Rd
Adds or updates vertex and edge attributes in an igraph
object
using user-provided metadata tables. Vertex attributes are matched by the first column of nodes_table
,
and edge attributes are matched using the first two columns of edge_table
, taking graph direction into account.
Only matching nodes and edges are updated. Warnings are issued when there are unmatched entries.
Arguments
- graph
An
igraph
object or a data frame containing a symbolic edge list.- nodes_table
Optional. A
data.frame
whose first column corresponds to vertex names.- edge_table
Optional. A
data.frame
whose first two columns correspond to source and target vertices.- overwrite
Logical. If
TRUE
, existing attributes are overwritten. IfFALSE
, existing attributes are preserved. Default isTRUE
.