View source: R/df_to_vert_attr.R
Given a graph and a data frame where vertex names correspond to a column in the data frame, map data in the data frame to attributes of the vertices in the graph.
1 | df_to_vert_attr(graph, df, common, attr_name, new_attr_name = NULL)
|
graph |
Graph of class ' |
df |
A data frame that has a column that contains vertex IDs
and at least one column that has data that will become a vertex attribute of |
common |
A character string providing the column name that contains the vertex IDs (i.e., the 'name' vertex attribute of the graph). |
attr_name |
A character vector providing the name(s) of the
column of |
new_attr_name |
A character vector providing the name(s) of the
new vertex attribute(s). If |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.