Learn R Programming

g6R (version 0.5.0)

g6_nodes: Create and validate lists of G6 elements

Description

Constructors for lists of G6 node, edge, and combo elements. Each function accepts multiple validated elements and returns a list with the appropriate class. All elements are validated on construction.

S3 generic for validating lists of G6 elements.

Usage

g6_nodes(...)

g6_edges(...)

g6_combos(...)

validate_elements(x, ...)

# S3 method for g6_nodes validate_elements(x, ...)

# S3 method for g6_edges validate_elements(x, ...)

# S3 method for g6_combos validate_elements(x, ...)

# S3 method for g6_nodes as_g6_nodes(x, ...)

# S3 method for data.frame as_g6_nodes(x, ...)

# S3 method for list as_g6_nodes(x, ...)

Value

An object of class g6_nodes, g6_edges, or g6_combos.

Invisibly returns the validated object.

Arguments

...

Additional arguments (unused).

x

An object of class g6_nodes, g6_edges, or g6_combos.

Examples

Run this code
nodes <- g6_nodes(
  g6_node(id = "n1"),
  g6_node(id = "n2")
)
edges <- g6_edges(
  g6_edge(source = "n1", target = "n2")
)
combos <- g6_combos(
  g6_combo(id = "c1")
)

Run the code above in your browser using DataLab