Learn R Programming

ggRandomForests (version 1.1.1)

combine: combine two gg_partial objects

Description

The combine.gg_partial function assumes the two gg_partial object were generated from the same randomForestSRC::rfsrc object. Further, we assume the combine is along the group variable.

Usage

combine(x, y, lbls, ...)

Arguments

x
gg_partial object
y
gg_partial object
lbls
how to label the combined data.
...
not used

Examples

Run this code
#!!TODO!! examples
# Calculate the 1 year partial dependence
pbc_prtl <- plot.variable(pbc_rf, surv.type = "surv",
                          time = 364.25,
                          xvar.names = xvar, partial = TRUE,
                          show.plots = FALSE)

# Calculate the 3 year partial dependence
pbc_prtl.3 <- plot.variable(pbc_rf, surv.type = "surv",
                            time = 3*364.25,
                            xvar.names = xvar, partial = TRUE,
                            show.plots = FALSE)

# Create gg_partial objects
ggPrtl <- gg_partial(pbc_prtl)
ggPrtl.3 <- gg_partial(pbc_prtl.3)

# Combine the objects to get multiple time curves
# along variables on a single figure.
pbc_ggpart <- combine(ggPrtl, ggPrtl.3,
                      lbls = c("1 Year", "3 Years"))

Run the code above in your browser using DataLab