Learn R Programming

rgr (version 1.1.0)

gx.rqpca.screeplot: Display a Scree Plot

Description

Function to display a scree plot arising from a Principal Components Analysis (PCA) from the saved object from gx.mva or gx.robmva. In addition to the screeplot the cumulative variability explained is also displayed.

Usage

gx.rqpca.screeplot(save, main = "", ...)

Arguments

save
a saved object from the execution of function gx.mva or gx.robmva.
main
an alternate plot title to that in the saved object, see Details below.
...
further arguments to be passed to methods concerning the plot. For example, if some colour other than black is required for the plotting characters, specify col = 2 to obtain red (see display.lty

Details

If main is undefined the name of the matrix object from which the PCA was derived is passed to the function via the saved object. Using the matrix name is the recommended procedure in the source functions as it helps to track the progression of the data analysis, acting as a record of the data source. However, at a presentation stage an alternate plot title may be preferred and can be defined in this function, e.g., main = "Plot Title Text". If no plot title is required set main = "".

See Also

gx.mva, gx.robmva

Examples

Run this code
## Make test data available
data(sind)
attach(sind)
sind.mat <- as.matrix(sind[, -c(1:3)])
## Ensure all data are in the same units (mg/kg)
sind.mat2open <- sind.mat
sind.mat2open[, 2] <- sind.mat2open[, 2] * 10000

## Save PCA results and display scree plot
sind.save <- gx.mva(ilr(sind.mat2open))
gx.rqpca.screeplot(sind.save)
gx.rqpca.screeplot(sind.save,
main = "Howarth & Sinding Larsen Stream Sediments
ilr transform",
pch = 4, col = 2, cex.main = 0.9)

## Clean-up and detach test data
rm(sind.mat)
rm(sind.mat2open)
rm(sind.save)

Run the code above in your browser using DataLab