Learn R Programming

ropls (version 1.4.2)

getSubsetVi: getSubsetVi method for (O)PLS(-DA) models

Description

Extracts the indices of the samples used for building the model (when a subset argument has been specified)

Usage

"getSubsetVi"(object)

Arguments

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

Value

Integer vector with the indices of the samples used for training

Examples

Run this code

data(sacurine)
attach(sacurine)

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

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

trainVi <- getSubsetVi(sacurine.plsda)

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

detach(sacurine)


Run the code above in your browser using DataLab