ctree_wrapper: ctree_wrapper

Description Usage Arguments Value See Also Examples

View source: R/parse_party.R

Description

A wrapper function to ctree

Usage

1
2
ctree_wrapper(response, covariates = NULL,
  tree_builder_parameters = list())

Arguments

response

Response variable to use in ctree model.

covariates

Covariates to use in ctree model.

tree_builder_parameters

A named list of parameters to pass to ctree.

Value

An object of class CTree

See Also

ctree

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
requireNamespace( "party", quietly = TRUE )
## From party::ctree() examples:
set.seed(290875)
airq <- subset(airquality, !is.na(Ozone))

## Provide response and covariates to fit ctree
ex1 <- ctree_wrapper( response = airq$Ozone,
                      covariates = subset( airq, select = -Ozone ) )

## Pass list of control parameters. Note that ctree takes a parameter called
## 'controls' (with an 's'), rather than 'control' as in rpart.
ex2 <- ctree_wrapper( response = airq$Ozone,
                      covariates = subset( airq, select = -Ozone ),
                      tree_builder_parameters = list( controls =
                                             party::ctree_control( maxdepth = 2 ) ) )

TSDT documentation built on May 2, 2019, 6:40 a.m.