withinVariation() on part of dataset

Merry Christmas and Happy New Year!

I am trying to perform withinVariation() function before fitting data into sPLS-DA and DIABLO. However, only one-third of subjects in my dataset have repeat measurements (pre- vs. post-drug treatment).

I compared the PCA with vs. without “multilevel = subjects” on these repeat measurements and the difference was quite obvious. I am wondering if I can only apply withinVariation() on the subjects with repeat measurements and then combine the output with the remaining dataset to fit sPLS-DA?

Thank you!