tidygraph (version 0.1.0)

activate: Determine the context of subsequent manipulations

Description

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.

Usage

activate(.data, what)

active(x)

Arguments

.data, x

A tbl_graph or a grouped_tbl_graph

what

What should get activated? Possible values are nodes or edges.

Value

A tbl_graph

Examples

Run this code
gr <- create_complete(5) %>%
  activate(nodes) %>%
  mutate(class = sample(c('a', 'b'), 5, TRUE)) %>%
  activate(edges) %>%
  arrange(from)

Run the code above in your browser using DataLab