plotPC: Plot Principal component (PC) Values (variation explained)...

Description Usage Arguments Value Author(s) See Also Examples

Description

The function plotPCvalues plots PC values (variation explained).
The function plotPCvectors plots PC vectors (loadings).

Usage

1
2
plotPCvalues(values, n = 40, ylim = NULL, col = "blue")
plotPCvectors(eigenvector, i, col = "blue1")

Arguments

values

Vector of PC values.

n

Number of top PCs to plot.

ylim

Numeric vectors of length 2, giving the y coordinate range. Exactly as in Plotting Parameters.

col

Color of the plotted points.

eigenvector

The i-th eigenvector. See eigen.

i

Indicates loadings of which PC to plot.

Value

This function creates a PC plot and returns nothing (NULL).

Author(s)

Andrey A Shabalin andrey.shabalin@gmail.com

See Also

See vignettes: browseVignettes("ramwas").

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Sample data
# for 1000 observations and 10 samples
m = 1000
n = 10
data = matrix(rnorm(n*m), nrow = m)

# Covariance and eigenvalue decomposition
covmat = crossprod(data)
e = eigen(covmat)

# Plot PC values
plotPCvalues(e$values)

# Plot PC vectors
plotPCvectors(e$vectors[,1], 1)
plotPCvectors(e$vectors[,2], 2)

ramwas documentation built on Nov. 8, 2020, 8:24 p.m.