Learn R Programming

muma (version 1.4)

Plot.pca: principal component analysis plotting

Description

Visualize PCA score and loading plots.

Usage

Plot.pca(pcx, pcy, scaling, test.outlier = TRUE)

Arguments

pcx
an integer indicating the principal component to be plotted in x
pcy
an integer indicating the principal component to be plotted in y
scaling
a character string indicating the name of the scaling previously specified in the function 'explore.data'
test.outlier
logical, indicating whether the geometric outlier testing has to be performed. By default is 'TRUE'.

Details

'test.outlier' results in a printed string indicating whether outliers were detected or not; if detected, the samples (rownames) identified as outliers are printed. Principal components to be plotted can be identified through the function 'explore.data'.

A directory called 'PCA-Data' is automatically created in the working directory. Within this directory are written PCA score and loading matrix and every PCA plot generated with the function 'plot.pca'.

Examples

Run this code

## The function is currently defined as
function (pcx, pcy, scaling, test.outlier = TRUE) 
{
    Plot.pca.score(pcx, pcy, scaling)
    Plot.pca.loading(pcx, pcy, scaling)
    if (test.outlier) {
        outlier(pcx, pcy, scaling)
    }
  }

Run the code above in your browser using DataLab