koplsPlotScores {kopls} | R Documentation |
Produces score plots from K-OPLS models. If model components are unspecified, all possible combinations are displayed as a scatter plot matrix. Otherwise, two selected components will be shown using a traditional 2D scatter plot.
koplsPlotScores(model, x = NA, xsub = "p", y = NA, ysub = "o")
model |
K-OPLS model (see koplsModel ). |
x |
x-axis score vector index. |
xsub |
Identifying value for x : Either 'p' for predictive component or 'o' for Y-orthogonal component. |
y |
y-axis score vector index. |
ysub |
Identifying value for y : Either 'p' for predictive component or 'o' for Y-orthogonal component . |
The diagnol of the scatter plot matrix depicts the kernel density of that particular score vector. Any additional parameters will be passed on to the plot() function, which can be used to e.g. set the color or shape of the displayed data points.
Max Bylesjo and Mattias Rantalainen
Rantalainen M, Bylesjo M, Cloarec O, Nicholson JK, Holmes E and Trygg J. Kernel-based orthogonal projections to latent structures (K-OPLS), J Chemometrics 2007; 21:376-385. doi:10.1002/cem.1071.
## Load data set data(koplsExample) ## Define kernel function parameter sigma<-25 ## Define number of Y-orthogonal components nox<-3 ## Construct kernel Ktr<-koplsKernel(Xtr,NULL,'g',sigma) ## Model model<-koplsModel(Ktr,Ytr,1,nox,'mc','mc'); #### Visualize results ## Shows all scores as scatter plot matrix ## col.vec defines class colors and is loaded by data(koplsExample) koplsPlotScores(model, col=col.vec) ## Shows tp1 vs to1, colored by class ## pch.vec defines class glyph types and is loaded by data(koplsExample) koplsPlotScores(model, x=1, xsub='p', y=1, ysub='o', col=col.vec, pch=pch.vec) ## Shows to1 vs to2 koplsPlotScores(model, x=1, xsub='o', y=2, ysub='o', col=col.vec, pch=pch.vec)