Learn R Programming

plsmod (version 0.0.1)

pls_fit: Wrapper for mixOmics pls functions

Description

Based on arguments, this wrapper routes the data and arguments to the four pls functions that are sparse/dense or regression/classification.

Usage

pls_fit(x, y, ncomp = NULL, keepX = NULL, ...)

Arguments

x

A data frame or matrix of predictors.

y

For classification, a factor. For regression, a matrix, vector, or data frame.

ncomp

The number of PLS components. If left null, the maximum possible is used.

keepX

The number of non-zero loadings per component. If the value is a vector, the value is left as-is. Otherwise, the scalar is expanded to be the same for all components. If NULL, either mixOmics::pls() or mixOmics::plsda() are used. Otherwise, their sparse analogs are used.

Value

A model object generated by mixOmics::pls(), mixOmics::plsda(), mixOmics::spls(), or mixOmics::splsda().