graph_join | 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 join specification created with If To join on different variables between To join by multiple variables, use a
For simple equality joins, you can alternatively specify a character vector
of variable names to join by. For example, To perform a cross-join, generating all combinations of |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.