tct_tree: Tree-like Factors

Description Usage Arguments Details Functions Examples

Description

The function tct_tree is used to encode a vector as a tree-like ordered factor. An tct_tree object is a factor, in that it inherits the factor and ordered classes, and can therefor be manipulated as such. The tct_tree class adds an attribute, tct_levels, that is a directed graph of class igraph.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13

Arguments

x

a vector of data.

tct_levels

an optional directed igraph object defining the ontology.

...

other parameters passed on to factor.

value

a vector of character strings with length at least the number of levels of x.

Details

tct_is_tree, is.tct_tree, tct_as_tree, and as.tct_tree, are the membership and coercion functions for the tct_tree class.

tct_levels provides access to the tct_levels attribute of a tct_tree. The first form returns the value of the levels of its argument and the second sets the attribute.

Functions

Examples

1
2
c("Kyle", "John", "Molly") %>%
  tct_tree()

bocinsky/treecats documentation built on May 25, 2019, 3:24 p.m.