project_opls: Projection function for the 'opls' function

View source: R/RcppExports.R

project_oplsR Documentation

Projection function for the opls function

Description

Projects new spectra onto a PLS space based on a model generated by either by opls or the opls2 functions. For internal use only!.

Usage

project_opls(projection_mat, ncomp, newdata, scale, Xcenter, Xscale)

Arguments

projection_mat

the projection matrix generated by the opls function.

ncomp

an integer value indicating how may components must be used in the prediction.

newdata

a matrix containing the predictor variables.

scale

a logical indicating whether the matrix of predictors used to create the regression model was scaled.

Xcenter

a matrix of one row with the values that must be used for centering newdata.

Xscale

if scale = TRUE a matrix of one row with the values that must be used for scaling newdata.

Value

a matrix corresponding to the new spectra projected onto the PLS space

Author(s)

Leonardo Ramirez-Lopez


resemble documentation built on May 29, 2024, 8:49 a.m.