PLS-DA plotting individuals

Hi there,

I’m wondering if its possible to visualize multiple components in 3D with PLS-DA. I see that this is possible with other methods in the mixomics package (such as rCCA). Is it possible to make a 3D plot or just a way to plot PC1 vs PC3 for the PLS-DA method?

Thanks,
Andrea

Hi @Andy,

It is in fact possible to customise the components plotted in 2D or plot in 3D. See example below.

# splsda model
data(breast.tumors)
X <- breast.tumors$gene.exp
Y <- as.factor(breast.tumors$sample$treatment)
res <- splsda(X, Y, ncomp = 3, keepX = c(25, 25, 25))
# plot components 1 and 3
plotIndiv(res, comp = c(1,3))
# plot 3D
plotIndiv(res, comp = c(1, 2, 3), style = '3d')

Hope it ehlps,

Al

1 Like

Hi,

I have a similar issue. However, I get an error when I use the 3d option saying

error: xp_attach_gl_context returned: 2
Error in open3d() : open failed
In addition: Warning message:
In open3d() : RGL: ERROR: can’t bind glx context to window

Any help appreciated.

I can’t seem to replicate your error @sreejata. I did some research online, the following links might help:

Unfortunately, without a Mac computer I am not going to be able to help here