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