Biological replicates and Diablo

Yes unfortunately, the method described in withinVariation() on part of dataset - #2 by MaxBladen would not be valid here. Also, as I say in that post, it’s a risky procedure and could invalidate your method.

Everything in your code looks appropriate and the way I’d do it. My main question is, are you tuning the values you used to form list.keepX? They seem fairly arbitrarily chosen. If so, that will significantly reduce block.splsda() from discriminating your two classes