pca {spatialRF}R Documentation

Principal Components Analysis

Description

Extracts all factors of a principal component analysis of a matrix or data frame. Just a convenient wrapper for prcomp.

Usage

pca(
  x = NULL,
  colnames.prefix = "pca_factor"
)

Arguments

x

numeric matrix or data frame, Default: NULL

colnames.prefix

character, name prefix for the output columns, Default: 'pca_factor'

Details

Columns in x with zero variance are removed before computing the PCA.

Value

A data frame with the PCA factors of x.

See Also

pca_multithreshold()

Examples

if(interactive()){

 #load example distance matrix
 data(distance_matrix)

 #PCA of the distance matrix
 out <- pca(x = distance_matrix)
 out

}

[Package spatialRF version 1.1.4 Index]