print.covregrf {CovRegRF}R Documentation

Print summary output of a CovRegRF analysis

Description

Print summary output of a CovRegRF analysis. This is the default print method for the package.

Usage

## S3 method for class 'covregrf'
print(x, ...)

Arguments

x

An object of class (covregrf, grow), (covregrf, predict) or (covregrf, significancetest).

...

Optional arguments to be passed to other methods.

Examples


## load generated example data
data(data, package = "CovRegRF")
xvar.names <- colnames(data$X)
yvar.names <- colnames(data$Y)
data1 <- data.frame(data$X, data$Y)

## define train/test split
set.seed(2345)
smp <- sample(1:nrow(data1), size = round(nrow(data1)*0.6), replace = FALSE)
traindata <- data1[smp,,drop=FALSE]
testdata <- data1[-smp, xvar.names, drop=FALSE]

## formula object
formula <- as.formula(paste(paste(yvar.names, collapse="+"), ".", sep=" ~ "))

## train covregrf
covregrf.obj <- covregrf(formula, traindata, params.rfsrc = list(ntree = 50))

## print the grow object
print(covregrf.obj)

## predict with new test data
pred.obj <- predict(covregrf.obj, newdata = testdata)

## print the predict object
print(pred.obj)


[Package CovRegRF version 1.0.1 Index]