Description Usage Arguments Value Author(s) See Also Examples
The function plotPCvalues
plots PC values (variation explained).
The function plotPCvectors
plots PC vectors (loadings).
1 2 | plotPCvalues(values, n = 40, ylim = NULL, col = "blue")
plotPCvectors(eigenvector, i, col = "blue1")
|
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 |
i |
Indicates loadings of which PC to plot. |
This function creates a PC plot and returns nothing (NULL
).
Andrey A Shabalin andrey.shabalin@gmail.com
See vignettes: browseVignettes("ramwas")
.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.