#' ## Examples from RFSRC package...
## ------------------------------------------------------------
## classification example
## ------------------------------------------------------------
## You can build a randomForest
# iris_rf <- rfsrc(Species ~ ., data = iris)
# ... or load a cached randomForestSRC object
data(iris_rf, package="ggRandomForests")
# Get a data.frame containing error rates
ggrf.obj<- gg_error(iris_rf)
# Plot the gg_error object
plot(ggrf.obj)
## ------------------------------------------------------------
## Regression example
## ------------------------------------------------------------
# airq_rf <- rfsrc(Ozone ~ ., data = airquality, na.action = "na.impute")
# ... or load a cached randomForestSRC object
data(airq_rf, package="ggRandomForests")
# Get a data.frame containing error rates
ggrf.obj<- gg_error(airq_rf)
# Plot the gg_error object
plot(ggrf.obj)
## ------------------------------------------------------------
## Survival example
## ------------------------------------------------------------
## veteran data
## randomized trial of two treatment regimens for lung cancer
# data(veteran, package = "randomForestSRC")
# veteran_rf <- rfsrc(Surv(time, status) ~ ., data = veteran, ntree = 100)
# Load a cached randomForestSRC object
data(veteran_rf, package="ggRandomForests")
ggrf.obj <- gg_error(veteran_rf)
plot(ggrf.obj)
Run the code above in your browser using DataLab