plotPC {ramwas} | R Documentation |
The function plotPCvalues
plots PC values (variation explained).
The function plotPCvectors
plots PC vectors (loadings).
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")
.
# 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)