Description Usage Arguments Value Examples
View source: R/gettree.ICcforest.R
Extract the i-th individual tree from the established ICcforest. The resulting object can be printed or plotted, and predictions can be made using it.
1 2 | ## S3 method for class 'ICcforest'
gettree(object, tree = 1L, ...)
|
object |
an object as returned by |
tree |
an integer, the number of the tree to extract from the forest. |
... |
additional arguments. |
An object of class party
.
1 2 3 4 5 6 7 8 9 10 11 12 | #### Example with dataset miceData
library(icenReg)
data(miceData)
## For ICcforest to run, Inf should be set to be a large number, for example, 9999999.
idx_inf <- (miceData$u == Inf)
miceData$u[idx_inf] <- 9999999.
## First, fit an iterval-censored conditional inference forest
Cforest <- ICcforest(formula = Surv(l,u,type="interval2")~grp, data = miceData, ntree = 50L)
## Extract the 50-th tree from the forest
plot(gettree(Cforest, tree = 50L))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.