Learn R Programming

ropls (version 1.4.2)

tested: Tested method for (O)PLS models

Description

Returns predictions of the (O)PLS(-DA) model on the out of the box samples (when a 'subset' of samples has been selected when training the model)

Usage

"tested"(object)

Arguments

object
An S4 object of class opls, created by opls function.

Value

Predictions (either a vector, factor, or matrix depending on the y response used for training the model)

Examples

Run this code

data(sacurine)
attach(sacurine)

testedorMN <- dataMatrix
responseFc <- sampleMetadata[, "gender"]

sacurine.plsda <- opls(testedorMN,
                       responseFc,
                       subset = "odd")

trainVi <- getSubsetVi(sacurine.plsda)

table(responseFc[trainVi], fitted(sacurine.plsda))

detach(sacurine)

Run the code above in your browser using DataLab