| graph_join {tidygraph} | R Documentation |
This graph-specific join method makes a full join on the nodes data and
updates the edges in the joining graph so they matches the new indexes of the
nodes in the resulting graph. Node and edge data is combined using
dplyr::bind_rows() semantic, meaning that data is matched by column name
and filled with NA if it is missing in either of the graphs.
graph_join(x, y, by = NULL, copy = FALSE, suffix = c(".x", ".y"), ...)
x |
A |
y |
An object convertible to a |
by |
a character vector of variables to join by. If To join by different variables on x and y use a named vector.
For example, |
copy |
If |
suffix |
If there are non-joined duplicate variables in |
... |
other parameters passed onto methods |
A tbl_graph containing the merged graph
gr1 <- create_notable('bull') %>%
activate(nodes) %>%
mutate(name = letters[1:5])
gr2 <- create_ring(10) %>%
activate(nodes) %>%
mutate(name = letters[4:13])
gr1 %>% graph_join(gr2)