Performs efficient eigendecomposition of an input covariance matrix based on
which principal axes that are wanted. If all axes are wanted,
RSpectra::eigs_sym is used if only the
highest or lowest eigenvalues with corresponding eigenvectors are requested.
pca(cov_mat, axes = 1:data_dim)
A covariance matrix.
A vector indicating which principal axes are wanted.
pca returns an S3 object of class "pca". This is a list with
the following components:
A matrix with the chosen principal axes/eigenvectors as rows.
A vector of the corresponding eigenvalues
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.