delete_global_graph_attrs: Delete one of the global graph attributes stored within a...

Description Usage Arguments Value Examples

View source: R/delete_global_graph_attrs.R

Description

Delete one of the global attributes stored within a graph object of class dgr_graph).

Usage

1
delete_global_graph_attrs(graph, attr = NULL, attr_type = NULL)

Arguments

graph

A graph object of class dgr_graph.

attr

The name of the attribute to delete for the type of global attribute specified.

attr_type

The specific type of global graph attribute to delete. 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
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Create a new graph and add
# some extra global graph attrs
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")

# Inspect the graph's global
# attributes
graph %>%
  get_global_graph_attr_info()

# Delete the `penwidth` attribute
# for the graph's nodes using the
# `delete_global_graph_attrs()` fcn
graph <-
  graph %>%
  delete_global_graph_attrs(
    attr = "penwidth",
    attr_type = "node")

# View the remaining set of global
# attributes for the graph
graph %>%
  get_global_graph_attr_info()

DiagrammeR documentation built on July 2, 2020, 3:19 a.m.