## Examples from randomForestSRC::rfsrc
##
data(pbc, package = "randomForestSRC")
pbc_rf <- rfsrc(Surv(days, status) ~ ., pbc, nsplit = 10)
# generate partial plot data for 4 different covariates.
pbc_prtl <- plot.variable(pbc_rf, time=90,surv.type="surv",
xvar.names = c("bili", "copper", "albumin", "age"),
partial=TRUE, show.plots=FALSE)
# Format for ggRandomForests
ggprtl <- gg_partial(pbc_prtl)
# Without specifying which plot, plot.gg_partial returns a list of all four
# figures.
plot(ggprtl)
plot.gg_partial(ggprtl[[1]])
plot.gg_partial(ggprtl[[4]])
Run the code above in your browser using DataLab