Set global graph attributes

Description

Set global attributes of a specific type (either graph_attrs, node_attrs, or edge_attrs for a graph object of class dgr_graph).

Usage

1
set_global_graph_attrs(graph, attr, value, attr_type)

Arguments

graph

a graph object of class dgr_graph.

attr

the name of the attribute to set for the type of global attribute specified.

value

the value to be set for the chosen attribute specified in the attr_for_type argument.

attr_type

the specific type of global graph attribute to set. The type is specified with graph, node, or edge.

Value

a graph object of class dgr_graph.

Examples

1
2
3
4
5
6
7
8
9
# Create a new graph and set some global attributes
graph <- create_graph() %>%
  set_global_graph_attrs(
    "overlap", "true", "graph")

# Verify that the global attributes have been set
get_global_graph_attrs(graph)
#>      attr value attr_type
#> 1 overlap  true     graph

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.