oak (version 0.2.1)

is.chain: Test if a tree is a chain

Description

The function is.chain returns TRUE if x is a chain, FALSE otherwise.

Usage

is.chain(x)

# S3 method for rtree is.chain(x)

Arguments

x

A tree to be tested.

Value

A logical.

Examples

Run this code
# NOT RUN {
## FALSE
is.chain(empty_tree())

## TRUE
(tr0 = c_("Bob", "Carl", "Daniel"))
is.chain(tr0)

## FALSE
(tr1 = r_(s = list(tr0)))
is.chain(tr1)

## FALSE
(tr = r_("titi", s = list(r_("toto"), r_("tata"))))
is.chain(tr)

# }

Run the code above in your browser using DataCamp Workspace