# NOT RUN {
# Create a new graph and add some global attributes
graph <-
create_graph() %>%
add_global_graph_attrs(
attr = "overlap",
value = "true",
attr_type = "graph") %>%
add_global_graph_attrs(
attr = "penwidth",
value = 3,
attr_type = "node") %>%
add_global_graph_attrs(
attr = "penwidth",
value = 3,
attr_type = "edge")
# View the graph's global attributes
get_global_graph_attrs(graph)
#> attr value attr_type
#> 1 overlap true graph
#> 2 penwidth 3 node
#> 3 penwidth 3 edge
# Delete the `penwidth` attribute for the graph's
# nodes using `delete_global_graph_attrs()`
graph <-
graph %>%
delete_global_graph_attrs(
attr = "penwidth",
attr_type = "node")
# View the remaining set of global
# attributes for the graph
get_global_graph_attrs(graph)
#> attr value attr_type
#> 1 penwidth 3 edge
#> 2 overlap true graph
# }
Run the code above in your browser using DataLab