plot.plsreg1: Plot PLS-R1 basic results

View source: R/plot.plsreg1.R

plot.plsreg1R Documentation

Plot PLS-R1 basic results

Description

Plot method for objects of class "plsreg1". This function plots either the variables or the observations, on the selected components (i.e. scores). Variables are plotted inside the circle of correlations. Observations are plotted on a scatter plot.

Usage

  ## S3 method for class 'plsreg1'
 plot(x, what = "variables",
    comps = c(1, 2), where = c("t", "t"), cex = 1,
    col.xlabels = "#5592e3", col.ylabel = "#fe9429",
    yfont = 2, pos = NULL, offset = 0.1,
    col.xarrows = "#5b9cf255", col.yarrows = "#fe942955",
    lwd = 3, length = 0, angle = 0, col.points = "#5592e3",
    pch = 21, pt.bg = "#5b9cf255", show.names = FALSE,
    xpd = TRUE, xlab = NULL, ylab = NULL, main = NULL,
    col.main = "gray35", cex.main = 1.2,
    col.axis = "gray40", show.grid = TRUE,
    col.grid = "gray95", ...)

Arguments

x

An object of class "plsreg1".

what

What to plot. Options are "variables" and "observations".

comps

An integer vector of length two to indicate which components to plot.

where

Where to plot the observations. A character vector of length two to indicate which components to use when plotting observations. This parameter will take into account the values in comps. Possible options are: c("t","u") for using x-y components, c("t","t"), for using x components, and c("u","u") for using y components. Default c("t","t").

cex

Character expansion for labels and points.

col.xlabels

Color for labels of X-block variables.

col.ylabel

Color for labels of Y-block variables.

yfont

Integer for specifying which font to use for Y-block labels. See font in graphical parameters par.

pos

Position for the text (see graphical paramaters par).

offset

When pos is specified, this value gives the offset of the labels.

col.xarrows

Color for the X-block arrows.

col.yarrows

Color for the Y-block arrows.

lwd

The line width of arrows.

length

Length of the edges of the arrow head (in inches).

angle

Angle from the shaft of the arrow to the edge of the arrow head.

col.points

Color for the points when what="observations".

pch

Plotting character symbol to use (see par).

pt.bg

Background (fill) color for the points given by pch=21:25.

show.names

Logical indicating whether to show labels of points. Only used when what="observations".

xpd

Logical for controlling clipping region of names and labels.

xlab

A title for the x axis.

ylab

A title for the y axis.

main

Main title of the plot.

col.main

Color of main title.

cex.main

Character expansion of main title.

col.axis

Color of axis annotations (tick marks and labels).

show.grid

Logical indicating whether to show grid lines.

col.grid

Color of grid lines. Only used when show.grid=TRUE.

...

Further arguments are passed to labels or points.

Details

Variables are displayed using the correlations in $cor.xyt.

Author(s)

Gaston Sanchez

See Also

plsreg1

Examples

## Not run: 
 # load dataset cornell
 data(cornell)

 # apply plsreg1
 myplsr1 = plsreg1(cornell[,1:7], cornell[,8,drop=FALSE])

 # plot variables (circle of correlations)
 plot(myplsr1, what="variables")

 # plot observations (as points) using components (t1,u1)
 plot(myplsr1, what="observations", comps=c(1,1), where=c("t","u"))

 # plot observations with names using components (t1,u1)
 plot(myplsr1, what="observations", comps=c(1,1),
      where=c("t","u"), show.names=TRUE)

 # plot observations (as points) using components (t1,t2)
 plot(myplsr1, what="observations", comps=c(1,2), where=c("t","t"))

 # plot observations (as points) using components (u1,u2)
 plot(myplsr1, what="observations", comps=c(1,2), where=c("u","u"))
 
## End(Not run)

gastonstat/plsdepot documentation built on Feb. 24, 2023, 11:11 a.m.