svkucheryavski / mdatools

R package for Multivariate Data Analysis
https://mda.tools
Other
33 stars 11 forks source link

Object with PLS-DA results must also have class `regres` #95

Closed svkucheryavski closed 3 years ago

svkucheryavski commented 3 years ago

Since PLS-DA is based on PLS regression, object for PLS-DA results contains all results from the corresponding regression model. To use this possibility, this object should also has class regres. Here is the code, which reproduces the problem

data(people)
X <- people[, -c(3, 9)]
c <- as.factor(people[, 9])

m <- plsda(X, c, 3, cv = 1)

plotRMSE(m)
plotPredictions.regmodel(m)

plotRMSE() raises an error and plotPredictions() shows wrong results.