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