suppose I have given an igraph graph in R and want to invert all edges:
see Transpose graph
library(igraph)
library(tidyverse)
g <- make_star(n=6)
plot(g)
gt <- transposeGraph(g) # hypothetical function
plot(gt)
One way seems to be to rebuild the graph, but I am concerned about the performance and the loss of vertex attributes:
gt <- graph_from_data_frame(as_data_frame(g) %>% select(to, from))
Any other ideas?