koplsPlotScores            package:kopls            R Documentation

_P_l_o_t_s _s_c_o_r_e_s _f_r_o_m _t_r_a_i_n_e_d _K-_O_P_L_S _m_o_d_e_l_s

_D_e_s_c_r_i_p_t_i_o_n:

     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.

_U_s_a_g_e:

     koplsPlotScores(model, x = NA, xsub = "p", y = NA, ysub = "o")

_A_r_g_u_m_e_n_t_s:

   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 .

_D_e_t_a_i_l_s:

     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.

_A_u_t_h_o_r(_s):

     Max Bylesjo and Mattias Rantalainen

_R_e_f_e_r_e_n_c_e_s:

     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.

_E_x_a_m_p_l_e_s:

     ## 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)

