scoreplot                package:pls                R Documentation

_P_l_o_t_s _o_f _S_c_o_r_e_s _a_n_d _L_o_a_d_i_n_g_s

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

     Functions to make scatter plots of scores and scatter or line
     plots of loadings.

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

     scoreplot(object, comps = 1:2, labels, identify = FALSE, type = "p", ...)
     ## S3 method for class 'scores':
     plot(x, ...)

     loadingplot(object, comps = 1:2, scatter = FALSE, labels, identify = FALSE,
                 type, ...)
     ## S3 method for class 'loadings':
     plot(x, ...)

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

  object: an 'mvr' object.  The fitted model.

   comps: integer vector.  The components to plot.

 scatter: logical.  Whether the loadings should be plotted as a scatter
          instead of as lines.

  labels: optional.  Labels to use instead of plotting symbols. Ignored
          in 'loadingplot' unless 'scatter = TRUE'.  Either a vector
          (of length > 1) of labels, or one of '"names"' and
          '"numbers"' for using row names and row numbers,
          respectively.

identify: logical.  Whether to use 'identify' to interactively identify
          points.  See below.

    type: character.  What type of plot to make.  Defaults to '"p"'
          (points) for scatter plots and '"l"' (lines) for line plots.

       x: a 'scores' or 'loadings' object.  The scores or loadings to
          plot.

     ...: further arguments sent to the underlying plot function(s).

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

     'plot.scores' is simply a wrapper calling 'scoreplot', passing all
     arguments.  Similarly for 'plot.loadings'.

     'scoreplot' makes one or more scatter plots of the scores,
     depending on how many components are selected.  If one or two
     components are selected, and 'identify' is 'TRUE', the function
     'identify' is used to interactively identify points.

     If 'scatter' is 'TRUE', 'loadingplot' works exactly like
     'scoreplot'.  Otherwise, it makes a lineplot of the selected
     loading vectors, and if 'identify' is 'TRUE', uses 'identify' to
     interactively identify points.

     'scoreplot' and 'loadingplot' can also be called through the plot
     method for 'mvr' objects, by specifying 'plottype' as '"scores"'
     or '"loadings"'.  See 'plot.mvr'.

     'scoreplot' and 'loadingplot' also work with 'princomp' objects. 
     (However, 'plot(scores(...))' and 'plot(loadings(...))' will not
     work.)

_V_a_l_u_e:

     The functions return whatever the underlying plot function (or
     'identify') returns.

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

     Ron Wehrens and Bjrn-Helge Mevik

_S_e_e _A_l_s_o:

     'mvr', 'plot.mvr', 'scores', 'loadings'

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

     data(NIR)
     mod <- plsr(y ~ X, ncomp = 10, data = NIR)
     ## These three are equivalent:
     ## Not run: scoreplot(mod, comps = 1:5)
     ## Not run: plot(scores(mod), comps = 1:5)
     ## Not run: plot(mvr, plottype = "scores", comps = 1:5)

     ## Not run: loadingplot(mod, comps = 1:5)
     ## Not run: loadingplot(mod, comps = 1:5, scatter = TRUE) # Plot as scatterplots

