### Examples from mixOmics packages
data(liver.toxicity)
X <- as.matrix(liver.toxicity$gene)
# Y will be transformed as a factor in the function,
# but we set it as a factor to set up the colors.
Y <- as.factor(liver.toxicity$treatment[, 4])
model <- sPLSda(X, Y, ncomp = 2, keepX = c(20, 20))
Run the code above in your browser using DataLab