Run Principal Components Analysis (PCA).

run_pca(
  mat,
  transpose = TRUE,
  center = TRUE,
  scale. = FALSE,
  rank. = NULL,
  ...
)

Arguments

mat

Matrix to run PCA on.

transpose

Whether to transpose the matrix first.

center

a logical value indicating whether the variables should be shifted to be zero centered. Alternately, a vector of length equal the number of columns of x can be supplied. The value is passed to scale.

scale.

a logical value indicating whether the variables should be scaled to have unit variance before the analysis takes place. The default is FALSE for consistency with S, but in general scaling is advisable. Alternatively, a vector of length equal the number of columns of x can be supplied. The value is passed to scale.

rank.

optionally, a number specifying the maximal rank, i.e., maximal number of principal components to be used. Can be set as alternative or in addition to tol, useful notably when the desired rank is considerably smaller than the dimensions of the matrix.

...

Additional parameters passed to prcomp.

Details

Uses prcomp.