plot.princals: Plot Methods for Princals

View source: R/plot.princals.R

plot.princalsR Documentation

Plot Methods for Princals

Description

Various plotting options for objects of class "princals".

Usage

## S3 method for class 'princals'
plot(x, plot.type = "loadplot", plot.dim = c(1, 2), var.subset = "all", 
col.scores = "black", col.loadings = "black", col.lines = "black", cex.scores = 0.8, 
cex.loadings = 0.8, stepvec = NA, max.plot.array = NA, expand = 1, 
asp = 1, main, xlab, ylab, xlim, ylim, ...)

Arguments

x

Object of class "princals"

plot.type

String indicating which type of plot to be produced: "biplot", "loadplot", "screeplot", "transplot". See details.

plot.dim

Vector with dimensions to be plotted.

var.subset

Numeric vector for subsetting variables to be plotted. If missing, all variables are taken into account. Ignored for non separate variable plots.

col.scores

Color object scores.

col.loadings

Color loading vectors.

col.lines

Line colors for transformation and scree plot.

cex.scores

Size object scores.

cex.loadings

Size loading labels.

asp

Aspect ratio

stepvec

Vector whether step function should be plotted (see details).

max.plot.array

Number of panels in transformation plot.

expand

Expansion factor for loadings in biplot.

main

Plot title.

type

Type of points/lines to be plotted.

xlab

Label of x-axis.

ylab

Label of y-axis.

xlim

Limits for x-axis.

ylim

Limits for y-axis.

...

Further plot arguments passed: see plot

Details

Plot description:

- Biplot (plot.type = "biplot"): Biplot with the object scores and the loadings. It uses biplot.default from stats internally (see corresponding help file for additional arguments)

- Transformation plot (plot.type = "transplot"): Plots the original scale against the transformed scale (first dimension) for each variable separately.

- Loadings plot (plot.type = "loadplot"): Plots the loadings of the variables and connects them with the origin.

- Scree plot (plot.type = "screeplot"): Produces a scree plot based on the eigenvalues.

For transformation plots only: If stepvec = NA, the function tries to figure out which variable should be plotted as step function. Alternatively, a boolean vector (with length number of variables) can be specified (TRUE step function, FALSE smooth function).

Examples

ABC6 <- ABC[,6:11]
fitord <- princals(ABC6, ndim = 3)  ## 3D princals solution

## transformation plot
plot(fitord, plot.type = "transplot", var.subset = 1:4, lwd = 2, col.lines = "coral")

## loadings plot
plot(fitord, "loadplot", main = "Loadings Plot ABC Data")

## biplot
plot(fitord, "biplot", main = "Biplot ABC Data", cex.scores = 0.5)  
plot(fitord, "biplot", main = "Biplot ABC Data")
plot(fitord, "biplot", main = "Biplot ABC Data", plot.dim = c(2,3))

## scree plot
plot(fitord, "screeplot")  

Gifi documentation built on Sept. 28, 2022, 3 a.m.

Related to plot.princals in Gifi...