| activate {tidygraph} | R Documentation |
As a tbl_graph can be considered as a collection of two linked tables it is
necessary to specify which table is referenced during manipulations. The
activate verb does just that and needs affects all subsequent manipulations
until a new table is activated. active is a simple query function to get
the currently acitve context.
activate(.data, what) active(x)
.data, x |
A tbl_graph or a grouped_tbl_graph |
what |
What should get activated? Possible values are |
A tbl_graph
Activate will ungroup a grouped_tbl_graph.
gr <- create_complete(5) %>%
activate(nodes) %>%
mutate(class = sample(c('a', 'b'), 5, TRUE)) %>%
activate(edges) %>%
arrange(from)