as.character.ModelTree: Convert a Model Tree to a String

Description Usage Arguments Value Examples

View source: R/modelTree.R

Description

Return or print a string representation of the combination of kernels represented by a given model tree

Usage

1
2
3
4
5
## S3 method for class 'ModelTree'
as.character(model.tree, show.node.ids = FALSE)

## S3 method for class 'ModelTree'
print(model.tree, show.node.ids = FALSE)

Arguments

model.tree

a modelTree object

show.node.ids

boolean indicating whether the string should be annotated with the associated node numbers.

Value

a string representing a modelTree object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
mt <- create.model.tree.builtin()
mt <- insert.kernel.instance(mt, 1, "SE", NULL)
mt <- insert.kernel.instance(mt, 1, "SE", "+")

as.character(mt) #"( SE.1 + SE.2 )"

as.character(mt, show.node.ids=TRUE) #"[3: ( [1: SE.1 :1] + [2: SE.2 :2] ) :3]"

print(mt) #"( SE.1 + SE.2 )"

print(mt, show.node.ids=TRUE) #"[3: ( [1: SE.1 :1] + [2: SE.2 :2] ) :3]"

mattdneal/gaussianProcess documentation built on May 21, 2019, 12:58 p.m.