Skip to contents

Returns the number of nodes in the graph.

Arguments

x

A caugi_graph object.

Value

An integer representing the number of nodes.

See also

Other caugi_graph methods: print()

Examples

cg <- caugi_graph(
  A %-->% B,
  class = "DAG"
)
length(cg) # 2
#> [1] 2

cg2 <- caugi_graph(
  A %-->% B + C,
  nodes = LETTERS[1:5],
  class = "DAG"
)
length(cg2) # 5
#> [1] 5