create_nodes {DiagrammeR} | R Documentation

## Create a data frame with nodes and their attributes

### Description

Combine several named vectors for nodes and their attributes into a data frame, which can be combined with other similarly-generated data frame, or, added to a graph object.

### Usage

    create_nodes(nodes, type = NULL, label = nodes, ...)

### Arguments

`nodes` | the node ID value(s) for the node(s) to be created.
`type` | an optional 'type' description for each node.
`label` | an optional label for each node.
`...` | one or more named vectors for associated attributes.

### Value

a data frame.

### Examples

    ## Not run:
    # Create a node data frame
    nodes <-
      create_nodes(nodes = c("a", "b", "c", "d"),
                   type = "letter",
                   label = TRUE,
                   style = "filled",
                   color = "aqua",
                   shape = c("circle", "circle",
                             "rectangle", "rectangle"),
                   value = c(3.5, 2.6, 9.4, 2.7))

    ## End(Not run)

[Package DiagrammeR version 0.8.2 Index]