PLS-DA classification

Hello,
I am very new to R. I was trying to build a PLS-DA model and prediction in R. I am looking to create a chart like the attached picture, but I am not sure how to do it. This chart can be done in other paid software such as Matlab etc. Can someone help me out with this, please? Thank you very much.

That is a very broad question, especially difficult to answer without any context to your experimental design or dataset(s). I’m assuming you’re using a sPLS1 methodology given the predicted response is continuous. The rough process I would follow if I were trying to replicate those figures:

  • Tune the optimal number of features and components via tune.spls.
  • Using these optimal values, run your spls() on a set of training data.
  • Use the sPLS model to make predictions on novel data points.
  • Take the prediction values and plot them against the sample index
  • Repeat for each individual response feature (Y)

With more context I can help guide you a bit more but unfortunately the question is a little to vague for me to give a specific answer