take node names from nodes to edges tidygraph

To take node names from nodes to edges in tidygraph using the R language, you can follow these steps:

  1. First, use the activate function to activate the edge context in the tidygraph object.
  2. Then, use the mutate function to create a new column in the edge data frame and set it equal to the node names corresponding to the "from" and "to" columns in the edge data frame. This can be achieved by using the node_names function to extract the node names.
  3. Finally, you can use the deactivate function to return to the previous context, completing the process of taking node names from nodes to edges in tidygraph.