# NOT RUN {
# Create a graph with 5 nodes and 4 edges
graph <-
create_graph() %>%
add_path(n = 5)
# Cache a count of edges after creating a selection
graph <-
graph %>%
select_edges_by_node_id(nodes = 2) %>%
cache_edge_count_ws(name = "edge_count")
# Get the number of edges stored in the cache
graph %>%
get_cache(name = "edge_count")
#> [1] 2
# }
Run the code above in your browser using DataLab