as.Node.BinaryTree: Convert a a 'SplitNode' from the party package to a...

Description Usage Arguments Examples

View source: R/node_conversion_party.R

Description

Convert a a SplitNode from the party package to a data.tree structure.

Usage

1
2
## S3 method for class 'BinaryTree'
as.Node(x, ...)

Arguments

x

The BinaryTree

...

additional arguments (unused)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
library(party)
airq <- subset(airquality, !is.na(Ozone))
airct <- ctree(Ozone ~ ., data = airq, 
               controls = ctree_control(maxsurrogate = 3))
               
tree <- as.Node(airct)
tree

print(tree, 
      "label", 
      criterion = function(x) round(x$criterion$maxcriterion, 3),
      statistic = function(x) round(max(x$criterion$statistic), 3)
      )

FindNode(tree, 6)$path

data.tree documentation built on Aug. 3, 2020, 5:12 p.m.