powered by
Add graph attributes to a graph from a data frame where each column represents an attribute. Note that only the first row of the data frame is used.
graph_attr_from_df(g, df)
Graph g with the graph attributes in df added.
g
df
the graph (an igraph object) to which the graph attributes should be added
data frame, or an object that can be converted to a data frame, where the first row contains a graph attribute in each column
g=igraph::graph_from_literal(1-2,2-3:4,3-4:5:6,5-1) df=data.frame(name="Test Graph",descr="A graph") graph_attr_from_df(g,df)
Run the code above in your browser using DataLab