## plot of individuals for objects of class 'rcc'
data(nutrimouse)
X <- nutrimouse$lipid
Y <- nutrimouse$gene
nutri.res <- rcc(X, Y, ncomp = 3, lambda1 = 0.064, lambda2 = 0.008)
plotIndiv(nutri.res) #(default)
col <- rep(c("blue", "red"), c(20, 20))
plotIndiv(nutri.res, ind.names = nutrimouse$diet, col = col)
legend(-2.2, -1.1, c("WT", "PPAR"), pch = c(16, 16),
col = c("blue", "red"), text.col = c("blue", "red"),
cex = 1, pt.cex = c(1.2, 1.2))
## plot of individuals for objects of class 'pls' or 'spls'
data(liver.toxicity)
X <- liver.toxicity$gene
Y <- liver.toxicity$clinic
toxicity.spls <- spls(X, Y, ncomp = 3, keepX = c(50, 50, 50),
keepY = c(10, 10, 10))
col <- rep(c("blue", "red", "darkgreen", "darkviolet"), c(16, 16, 16, 16))
cex <- rep(c(1, 1.2, 1, 1.4), c(16, 16, 16, 16))
pch <- rep(c(15, 16, 17, 18), c(16, 16, 16, 16))
plotIndiv(toxicity.spls, comp = 1:2, ind.names = FALSE,
rep.space = "X-variate", col = col, cex = cex, pch = pch)
legend(0.22, -0.24, c("50 mg/kg", "150 mg/kg", "1500 mg/kg", "2000 mg/kg"),
col = c("blue", "red", "darkgreen", "darkviolet"),
pch = c(15, 16, 17, 18), pt.cex = c(1, 1.2, 1, 1.4),
title = "Treatment")
Run the code above in your browser using DataLab