powered by
Randomly shuffles the IDs of the nodes in a given graph and optionally plots the shuffled graph.
shuffle_graph_ids(g, plot = FALSE)
An igraph object with shuffled node IDs.
An igraph object representing the graph.
Logical. If TRUE, the function will plot the shuffled graph. Default is FALSE.
TRUE
FALSE
# Create an example graph g <- make_tree(n_cases = 10, R = 2) # Shuffle the node IDs shuffled_graph <- shuffle_graph_ids(g, plot = TRUE)
Run the code above in your browser using DataLab