Skip to contents

Calculate the PCA rotation matrix The implementation is based on stats::prcomp. Assumes the data has already been centered and scaled (if that is desired).

Usage

simple_pca(X, dimensions, tolerance = 1e-10)

Arguments

X

the matrix to reduce

dimensions

the number of dimensions after PCA

tolerance

remove components with variance less than the tolerance

Value

pca rotation matrix