# Create a node data frame (ndf)
nodes <-
create_nodes(
nodes = LETTERS,
label = TRUE,
type = c(rep("a_to_g", 7),
rep("h_to_p", 9),
rep("q_to_x", 8),
rep("y_and_z", 2)))
# Create an edge data frame (edf)
edges <-
create_edges(
from = sample(LETTERS, replace = TRUE),
to = sample(LETTERS, replace = TRUE),
rel = "letter_to_letter")
# Create a graph using the ndf and edf
graph <-
create_graph(
nodes_df = nodes,
edges_df = edges)
# Is there any edge between nodes with IDs
# `A` and `B`?
edge_present(graph, from = "A", to = "B")
#> FALSE
# Verify that there is an edge between nodes
# `K` and `V`
edge_present(graph, from = "K", to = "V")
#> TRUE
Run the code above in your browser using DataLab