node_data: Insert node data attributes during node creation

Description Usage Arguments See Also Examples

View source: R/node_data.R

Description

This helper function should be invoked to provide values for the namesake node_data argument, which is present in any function where nodes are created.

Usage

1

Arguments

...

Node data attributes provided as one or more named vectors.

See Also

Other Node creation and removal: add_n_node_clones(), add_n_nodes_ws(), add_n_nodes(), add_node_clones_ws(), add_node_df(), add_nodes_from_df_cols(), add_nodes_from_table(), add_node(), colorize_node_attrs(), copy_node_attrs(), create_node_df(), delete_nodes_ws(), delete_node(), drop_node_attrs(), join_node_attrs(), layout_nodes_w_string(), mutate_node_attrs_ws(), mutate_node_attrs(), recode_node_attrs(), rename_node_attrs(), rescale_node_attrs(), set_node_attr_to_display(), set_node_attr_w_fcn(), set_node_attrs_ws(), set_node_attrs(), set_node_position()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Create a new graph and add
# a path with several node
# data attributes
graph <-
  create_graph() %>%
  add_path(
    n = 3,
    type = "path",
    node_data = node_data(
      hour = 5,
      index = c(1, 3, 2)))

# View the graph's internal
# node data frame; the node
# data attributes have been
# inserted
graph %>% get_node_df()

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